|
| 1 | + |
| 2 | +# source |
| 3 | +# https://makandracards.com/makandra/1090-customize-your-bash-prompt |
| 4 | + |
| 5 | +export PS1='\h \w$(__git_ps1 "(%s)") \$ ' |
| 6 | +=> mycomputer ~/apps/chess/tmp(master) $ _ |
| 7 | + |
| 8 | +export PS1='\[\e[33m\]\h\[\e[0m\]:\W\[\e[33m\]$(__git_ps1 "(%s)")\[\e[0m\] \u\$ ' |
| 9 | +=> mycomputer:tmp(master) tom$ _ |
| 10 | + |
| 11 | +# Henning's awesome TRON prompt 2.0.2 with current Git branch and success state of the last command (the syntax coloring here does not do it justice): |
| 12 | +export PS1='`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;30m\]\h\[\033[01;34m\] \w\[\033[35m\]$(__git_ps1 " %s") \[\033[01;30m\]>\[\033[00m\] ' |
| 13 | +=> ✔ mycomputer ~/projects/platforms master > _ |
| 14 | + |
| 15 | +# Arne's epic timestamped prompt with return status indicator and status-colored (green or red, if unstaged) git branch: |
| 16 | +export PS1='\[\e[01;30m\]\t `if [ $? = 0 ]; then echo "\[\e[32m\]"; else echo "\[\e[31m\]✘"; fi` \[\e[00;37m\]\u\[\e[01;37m\]:`[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "\[\e[31m\]" || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\]\$ ' |
| 17 | +=> 03:13:37 ✔ arne:(master)~/projects/geordi$ _ |
| 18 | + |
| 19 | +# Arne's danger prompt for root use. No git information and alarming red and yellow (which you can't see here): |
| 20 | +export PS1='\[\e[01;30m\]\t \[\e[31m\]\u\[\e[37m\]:\[\e[33m\]\w\[\e[31m\]\$\[\033[00m\] ' |
| 21 | +=> 03:13:37 root:/tmp/foo# _ |
| 22 | + |
| 23 | +# Kim's mix of those above with small changes. TRON promt with timestamp, return status indicator, hostname, git informations and working directory (but all non-bold). |
| 24 | +export PS1='\[\033[01;30m\]\t `if [ $? = 0 ]; then echo "\[\033[01;32m\]ツ"; else echo "\[\033[01;31m\]✗"; fi` \[\033[00;32m\]\h\[\033[00;37m\]:\[\033[31m\]$(__git_ps1 "(%s)\[\033[01m\]")\[\033[00;34m\]\w\[\033[00m\] >' |
| 25 | +=> 03:13:37 ツ mycomputer:(master)~/code/foo > |
| 26 | + |
| 27 | +# Kim's root promt (the same as above without git and the hostname is red) |
| 28 | +export PS1='\[\033[01;30m\]\t `if [ $? = 0 ]; then echo "\[\033[01;32m\]ツ"; else echo "\[\033[01;31m\]✗"; fi` \[\033[00;31m\]\h\[\033[00;37m\]:\[\033[00;34m\]\w\[\033[00m\] >' |
| 29 | +=> 03:13:37 ツ mycomputer:~/code/foo > |
0 commit comments