Skip to content

Instantly share code, notes, and snippets.

@pataluc
pataluc / notifyosd.zsh
Last active December 11, 2015 20:19 — forked from ihashacks/notifyosd.zsh
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
if [ ! -z "$cmd" ]; then
cmd_end=`date +%s`
((cmd_time=$cmd_end - $cmd_start))
fi
if [ ! -z "$cmd" -a $cmd_time -gt 10 ]; then
notify-send -i utilities-terminal -u low "$cmd_basename completed" "\"$cmd\" took $cmd_time seconds"
unset cmd
fi