mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Format the time as mm:ss, not just m
I prefer `12:34` over `754s` since it's more readable, but feel free to disreguard if you don't think it's necessary.
This commit is contained in:
parent
192de6bcff
commit
305cf8230b
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue