Commit 96ada576 authored by Valentin Samir's avatar Valentin Samir

[bash_alias] Add notication alias for long commands

$ long_command; alert "long_command ended"
parent d6834d42
......@@ -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 |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment