Tuesday, June 7, 2011

Let me know when it is done

A convenient way to get notified when waiting for a long process to end is to use the alert command/alias. On ubuntu, while copying a large file or compiling a program which takes a long time; I would switch to read emails or facebook and lose focus of my current task. Alert notifies you once the process is over and helps me get back on track. 

How do you use alert?


a-long-process; alert 


incase you are missing the alert alias, just add this to your .bashrc or .profile

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$//'\'')"'

No comments:

Post a Comment