If you followed my last post on new features in elementary OS Freya, you would know that it is ‘introducing’ a new terminal feature. This new feature is desktop notification when a command completes in terminal. I particularly liked this feature because some command takes quite some time in complete and I get distracted in the mean time. This notification alerts me to go back to what I was doing.
While this is a default feature in elementary OS Freya, rest of the Linux users need not to despair. You can get notification for terminal command completion in Ubuntu 14.04, 14.10. 15.04 and other Linux distributions such as Linux Mint 17, Pinguy OS etc, thanks to undistract-me.
Get desktop notification for command completion in Ubuntu 14.04
undistract-me is a utility that uses notify-usd to notify you of a console command completion. It works only with Bash. To install undistract-me, use the following command in a terminal:
sudo apt-get install undistract-me
How to use it
To make undistract-me work, you’ll need to do some modification in the ~/.bashrc file. Open it with your favorite text editor and add the following line to it:
Source the bashrc file like this:
By default it notifies on the completion, if a command runs for more than 10 second. You can change this default behavior by changing the value of LONG_RUNNING_COMMAND_TIMEOUT in file /usr/share/undistract-me/long-running.bash
If you want to test whether or not undistract-me works properly, just run sleep 11 in the terminal. This will just wait for 11 second and at the end of it, you should see a notification like this:
Even if you do not program, you might find it handy while installing an application via PPA. The apt-get update command might take some time to run, depending upon available updates and your network speed.
I hope you find this little tool useful in your desktop Linux experience with terminal notification. In other terminal trick, you can change sudo password time period. If you have questions or suggestion, feel free to drop a comment.