This commit is contained in:
shale 2015-08-20 18:15:53 +00:00
commit 507b990e2f

View file

@ -13,8 +13,10 @@ autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
if ! (type bgnotify_formatted | grep -q 'function'); then if ! (type bgnotify_formatted | grep -q 'function'); then
function bgnotify_formatted { function bgnotify_formatted {
## exit_status, command, elapsed_time ## exit_status, command, elapsed_seconds
[ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)" minutes=$(( $3 / 60 ))
seconds=$(( $3 % 60 ))
[ $1 -eq 0 ] && title="#win (took $minutes:$seconds)" || title="#fail (took $minutes:$seconds)"
bgnotify "$title" "$2" bgnotify "$title" "$2"
} }
fi fi