28
28
[ -d " $BYOBU_PREFIX " ] || BYOBU_PREFIX=" /usr"
29
29
[ -r " $BYOBU_PREFIX /lib/byobu/include/dirs" ] && . " $BYOBU_PREFIX /lib/byobu/include/dirs"
30
30
31
+ byobu_prompt_git () { git branch 2> /dev/null | sed -e " /^[^*]/d" -e " s/* \(.*\)/ (\1)/" ; }
31
32
byobu_prompt_status () { local e=$? ; [ $e != 0 ] && echo -e " $e " ; }
32
33
byobu_prompt_symbol () { [ " $USER " = " root" ] && printf " %s" " #" || printf " %s" " \$ " ; }
33
34
byobu_prompt_runtime () {
@@ -51,15 +52,15 @@ byobu_prompt_runtime() {
51
52
[ " $hours " = " 0" ] && hours= || hours=" ${hours} h "
52
53
[ " $minutes " = " 0" ] && minutes= || minutes=" ${minutes} m "
53
54
str=" ${days}${hours}${minutes}${seconds} .${microseconds} s"
54
- printf " [%s]" " $str " 1>&2
55
+ printf " [%s] " " $str " 1>&2
55
56
}
56
57
# Requires Bash 4.x
57
58
export PS0=' $(printf "%s" ${EPOCHREALTIME/./} >"$BYOBU_RUN_DIR/timer.$$")'
58
59
59
60
case " $BYOBU_DISTRO " in
60
61
" Ubuntu" )
61
62
# Use Ubuntu colors (grey / orange / aubergine)
62
- export PS1=" ${debian_chroot: +($debian_chroot )} \[\e[38 ;5;202m\]\$ (byobu_prompt_status)\[\e[00m\]\$ (byobu_prompt_runtime) \[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;172m\]\h\[\e[00m\]:\[\e[38;5;5m\]\w\[\e[00m\]\$ (byobu_prompt_symbol) "
63
+ export PS1=" ${debian_chroot: +($debian_chroot )} \[\e[03 ;5;15; 202m\]\$ (byobu_prompt_status)\[\e[00m\]\$ (byobu_prompt_runtime)\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;172m\]\h\[\e[00m\]:\[\e[38;5;5m\]\w\[\e[00m\]\e[38;5;102m\] \$ (byobu_prompt_git) \e[00m\]\$ (byobu_prompt_symbol) "
63
64
export GREP_COLORS=" ms=01;38;5;202:mc=01;31:sl=:cx=:fn=01;38;5;132:ln=32:bn=32:se=00;38;5;242"
64
65
export LESS_TERMCAP_mb=$( printf ' \e[01;31m' ) # enter blinking mode – red
65
66
export LESS_TERMCAP_md=$( printf ' \e[01;38;5;180m' ) # enter double-bright mode – bold light orange
@@ -75,14 +76,14 @@ case "$BYOBU_DISTRO" in
75
76
fi
76
77
;;
77
78
" Wolfi" )
78
- # Use Wolfi colors (pink / purple / grey )
79
+ # Use Wolfi colors (pink / purple / blue )
79
80
# For reference: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg
80
81
# Convert hex to 256: https://gist.githubusercontent.com/MicahElliott/719710/raw/73d047f0a3ffc35f0655488547e7f24fa3f04ea6/colortrans.py
81
82
# Use Wolfi colors (pink=170 / purple=98 / blue=63); flashing error code on previous command non-zero exit
82
- PS1=" \[\e[03;5;15;54m\]\$ (byobu_prompt_status)\[\e[00m\]\$ (byobu_prompt_runtime) \[\e[38;5;170m\]\u\[\e[00m\]@\[\e[38;5;98m\]\h\[\e[00m\]:\[\e[38;5;63m\]\w\[\e[00m\]\$ (byobu_prompt_symbol) "
83
+ PS1=" \[\e[03;5;15;54m\]\$ (byobu_prompt_status)\[\e[00m\]\$ (byobu_prompt_runtime)\[\e[38;5;170m\]\u\[\e[00m\]@\[\e[38;5;98m\]\h\[\e[00m\]:\[\e[38;5;63m\]\w\[\e[00m\]\e[38;5;45m\] \$ (byobu_prompt_git) \e[00m\]\$ (byobu_prompt_symbol) "
83
84
;;
84
85
* )
85
86
# Use Googley colors (blue / red / yellow / blue / green / red )
86
- PS1=" ${debian_chroot: +($debian_chroot )} \[\e[31m\]\$ (byobu_prompt_status)\[\e[38;5;69m\]\u\[\e[38;5;214m\]@\[\e[38;5;167m\]\h\[\e[38;5;214m\]:\[\e[38;5;71m\]\w\[\e[38;5;214m\]\$ (byobu_prompt_symbol)\[\e[00m\] "
87
+ PS1=" ${debian_chroot: +($debian_chroot )} \[\e[31m\]\$ (byobu_prompt_status)\[\e[38;5;69m\]\u\[\e[38;5;214m\]@\[\e[38;5;167m\]\h\[\e[38;5;214m\]:\[\e[38;5;71m\]\w\[\e[38;5;214m\]\$ (byobu_prompt_git) \$ ( byobu_prompt_symbol)\[\e[00m\] "
87
88
;;
88
89
esac
0 commit comments