diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-01-15 13:02:54 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-01-15 16:11:52 +0200 |
commit | ce7316136570efd9aea2dc504b072549d06a73d4 (patch) | |
tree | 4729c2938214afa0452a2b1be6495b975d7022f3 /bashrc | |
parent | a1f167c6e4066a2023db572f091f46ca0874fa65 (diff) | |
download | liw-dot-files-ce7316136570efd9aea2dc504b072549d06a73d4.tar.gz |
Add taskwarrior context to PS1
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -63,6 +63,14 @@ QL() esac } +task_context() +{ + local context="$(task context list | awk '$NF == "yes" { print $1 }')" + case "$context" in + ?*) echo "{{ $context }} " ;; + esac +} + iconpart="`whoami`@`hostname`: " titlepart="`whoami`@`hostname` -- " prompt_command() { @@ -79,7 +87,7 @@ prompt_command() { fi base="`basename "$PWD"`" str2xterm "$base - $iconpart$PWD" "$base - $titlepart$PWD" - PS1="\\[$(start_error)$(QL)$(normal_mode )\\]\\[$(start_bold)\\]$debian_chroot\\u@\\h$(git_prompt_part)\\[$(basename_mode)\\](\W)\\[$(start_bold)\\]\\$ \\[$(normal_mode)\\]" + PS1="\\[$(start_error)$(task_context)$(QL)$(start_bold)\\]\\u@\\h$(git_prompt_part)\\[$(basename_mode)\\](\W)\\[$(start_bold)\\]\\$ \\[$(normal_mode)\\]" } we_have_term() |