Last active
June 26, 2018 21:36
-
-
Save tpraxl/ba0d4b0470d1f0a802823bdc726412f0 to your computer and use it in GitHub Desktop.
Custom agnoster task warrior theme
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
## ~/.oh-my-zsh/custom/themes/customized-agnoster.zsh-theme | |
## | |
## Inspired by Paul '@pjf' Fenwick ( https://www.youtube.com/watch?v=zl68asL9jZA ) | |
## Keep the common agnoster.zsh-theme just as it | |
[…] | |
## Insert custom function right before Main prompt | |
## custom function to display the amount of overdue tasks, tasks due today, tasks due tomorrow and urgent tasks: | |
prompt_taskwarrior() { | |
TASK="task" | |
OVERDUE_COUNT=$($TASK +READY +OVERDUE count) | |
DUE_TODAY_COUNT=$($TASK +READY +DUETODAY count) | |
DUE_TOMORROW_COUNT=$($TASK +READY +TOMORROW count) | |
URGENT_COUNT=$($TASK +READY 'urgency > 10' count) | |
if [[ $OVERDUE_COUNT -gt 0 ]]; then | |
prompt_segment red white "💀$OVERDUE_COUNT" | |
fi | |
if [[ $DUE_TODAY_COUNT -gt 0 ]]; then | |
prompt_segment white blue "❢ $DUE_TODAY_COUNT" | |
fi | |
if [[ $DUE_TOMORROW_COUNT -gt 0 ]]; then | |
prompt_segment yellow black "🗓 $DUE_TOMORROW_COUNT" | |
fi | |
if [[ $URGENT_COUNT -gt 0 ]]; then | |
prompt_segment red white "😰 $URGENT_COUNT" | |
fi | |
} | |
## Main prompt | |
build_prompt() { | |
RETVAL=$? | |
prompt_status | |
prompt_virtualenv | |
prompt_context | |
prompt_taskwarrior | |
prompt_dir | |
prompt_git | |
prompt_bzr | |
prompt_hg | |
prompt_end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment