[zsh] alert alias

This commit is contained in:
Mathieu Maret 2012-07-03 09:34:01 +02:00
parent 1c35699739
commit eb8835848f

View File

@ -42,3 +42,7 @@ alias -g L='|less -R'
# command S equivalent to command &> /dev/null & # command S equivalent to command &> /dev/null &
alias -g S='&> /dev/null &' alias -g S='&> /dev/null &'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'