From 96ada576e22181201a776a5f2858257f27d7044c Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 22 Jul 2013 17:01:54 +0200 Subject: [PATCH] [bash_alias] Add notication alias for long commands $ long_command; alert "long_command ended" --- .bash_aliases | 5 +++++ 1 file changed, 5 insertions(+) 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 | -- 2.39.2