From: Valentin Samir Date: Mon, 22 Jul 2013 15:01:54 +0000 (+0200) Subject: [bash_alias] Add notication alias for long commands X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=96ada576e22181201a776a5f2858257f27d7044c;p=config-20-100.git [bash_alias] Add notication alias for long commands $ long_command; alert "long_command ended" --- diff --git a/.bash_aliases b/.bash_aliases index 9d47f37..e6aef58 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -112,6 +112,11 @@ alias pdfpages="find . -name '*.pdf' -exec pdfinfo {} \; | egrep '^Pages'" # et pour les sommer alias pdfpagessum='pdfpages | awk "{print \$2}" | paste -sd+ | bc' +# Add an "alert" alias for long running commands. Use like so: +# long_command; 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$//'\'')"' + + # +------------+ # | Cool stuff |