Last active
October 18, 2024 22:21
-
-
Save darakeon/c892a4fea99cef9bae4d4348ff3058c8 to your computer and use it in GitHub Desktop.
PS1: variable to what your bash will print before each interaction with you
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your ~/.bashrc | |
# With docker running machines counter: | |
export PS1="\n\n[\[\033[01;30m\]\A\[\033[00m\]] 🐳\$(docker ps -q | wc -l) \[\033[01;31m\]\u\[\033[00m\]@\[\033[01;35m\]\`if [[ \$PWD = /mnt/c* ]]; then echo \"#\"; else echo \"&\"; fi\`/\W\[\033[00m\]$ " | |
# With docker running machines / stopped machines counter: | |
export PS1="\n\n[\[\033[01;30m\]\A\[\033[00m\]] 🐳\$(docker ps -q | wc -l)/\$(docker ps -a -q | wc -l) \[\033[01;31m\]\u\[\033[00m\]@\[\033[01;35m\]\`if [[ \$PWD = /mnt/c* ]]; then echo \"#\"; else echo \"&\"; fi\`/\W\[\033[00m\]$ " | |
# No docker counters: | |
export PS1="\n\n[\[\033[01;30m\]\A\[\033[00m\]] \[\033[01;31m\]\u\[\033[00m\]@\[\033[01;35m\]\`if [[ \$PWD = /mnt/c* ]]; then echo \"#\"; else echo \"&\"; fi\`/\W\[\033[00m\]$ " | |
# Docker and git branch | |
export PS1="\n\n🐳 \$(docker ps -q | wc -l)/\$(docker ps -a -q | wc -l) \$(__git_ps1 '🌱 %s')\n[\e[01;30m\A\e[0m] \e[01;31m\u\e[00m@\e[01;35m\`if [[ \$PWD = /mnt/c* ]]; then echo \"#\"; else echo \"&\"; fi\`/\W\e[00m$ " | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment