diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-01-27 21:15:35 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-01-27 21:15:35 +0200 |
commit | c8b6e5a81dc60d615e613eff2d6286577c487de0 (patch) | |
tree | 160c07e7f1d2cac7265a78dc058b10285f728945 /bashrc | |
parent | 1bd6d0633c4c402466150108cde692845267ef31 (diff) | |
download | liw-dot-files-c8b6e5a81dc60d615e613eff2d6286577c487de0.tar.gz |
Reorder PS1 elements and use blue for it
The colour'll make it easier to spot prompts in long backscrolls.
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -22,6 +22,9 @@ raw_termattr() red) tput setaf 1 ;; + blue) + tput setaf 4 + ;; bold) tput bold ;; @@ -49,7 +52,7 @@ termattr() taskwarrior_context() { - if command -v task > /dev/null && [ -e .task ] && [ -e .task ] + if command -v task > /dev/null && [ -e "$HOME/.task" ] then task context list | awk '$NF == "yes" { print $1 }' fi @@ -126,16 +129,19 @@ wrap_if_nonempty() define_ps1() { - wrap_if_nonempty "$(taskwarrior_context)" "$(termattr bold)" "$(termattr normal) " - wrap_if_nonempty "$(QL)" "$(termattr red bold)" "$(termattr normal)" + wrap_if_nonempty "$(taskwarrior_context)" "$(termattr red)" "$(termattr normal) " + wrap_if_nonempty "$(QL)" "$(termattr bold red)" "$(termattr normal)" + + termattr bold blue + printf '\w ' + termattr normal if is_git_repo then - wrap_if_nonempty "$(get_git_branch)" "$(termattr bold)[" "]$(termattr normal)" + wrap_if_nonempty "$(get_git_branch)" "$(termattr bold blue)[" "]$(termattr normal)" fi - printf '(\w)' - termattr bold + termattr bold blue printf '\$ ' termattr normal } |