Skip to content

Instantly share code, notes, and snippets.

@real-or-random
Last active October 29, 2019 12:09
Show Gist options
  • Save real-or-random/6c789a436ec6ef391a48c910b1d6f147 to your computer and use it in GitHub Desktop.
Save real-or-random/6c789a436ec6ef391a48c910b1d6f147 to your computer and use it in GitHub Desktop.
Simple timewarrior segment for powerlevel10k
function prompt_timewarrior() {
emulate -L zsh
setopt pipefail
(( $+commands[timew] )) || return
local line IFS
timew 2>/dev/null | read -r line || return
local tags=${line#Tracking }
[[ -n $tags && $tags != $line ]] || return
p10k segment -f 208 -i $'\uFA1A' -t $tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment