Dustin Kirkland, Core Developer of the Ubuntu Server posted something very interesting on his blog: an alias you can add to your .bashrc file to get notified when a job you run in a terminal is done.
Setting everything up
- To use it, simply edit your ~/.bashrc file:
and paste this at the end of the file:
alias alert_helper='history|tail -n1|sed -e "s/^\s*[0-9]\+\s*//" -e "s/;\s*alert$//"'
alias alert='notify-send -i /usr/share/icons/gnome/32x32/apps/gnome-terminal.png "[$?] $(alert_helper)"'
- Now source your .bashrc:
Try it out
To get notified when a job you run in a terminal is done, add "; alert" at the end of a command (without the quotes).
As a test command you can run:
sleep 20; alert
Example: If you want to get notified when you compile some program, run the "make" command like this:
Many thanks to Dustin Kirkland for the alias!