From eb8835848f625a7d4e92b0bb1c1dc181f5912981 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Tue, 3 Jul 2012 09:34:01 +0200 Subject: [PATCH] [zsh] alert alias --- .zsh/30_alias.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.zsh/30_alias.zsh b/.zsh/30_alias.zsh index 98ee218..4221ddd 100644 --- a/.zsh/30_alias.zsh +++ b/.zsh/30_alias.zsh @@ -42,3 +42,7 @@ alias -g L='|less -R' # command S equivalent to command &> /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$//'\'')"'