|The other day, reading the excellent blog WebUpd8, I discovered a tool to receive a notification at the end of the execution a command in the terminal, which can be useful in cases where this task can take several minutes. Honestly, I do not think it is the best solution. For that reason, here we propose other alternativesPlus traineeships and simple.|
Andrew's recommended tool is Unidstract-me.
Installation in Ubuntu and derivatives:
sudo add-apt-repository ppa: undistract-me-packagers / daily sudo apt-get update sudo apt-get install undistract-me
To use it, you must enable the option "Run command as login terminal" in the terminal of your preference. In the one that comes with GNOME we can enable this option under Edit> Profile Preferences.
Once installed, any command that takes more than 10 seconds will display a message upon completion.
The advantage of the methods shown below are several:
- they run only when the user requests it
- do not require the installation of additional programs (usually the necessary packages are already installed in almost all popular distros)
- if laziness eats away at you, you can easily turn them into a script
- they are super fast, do not consume resources and are easy to learn
To display Ubuntu-style Notification messages, you must have notify-send installed. Ubuntu, Linux Mint, and derivatives come with this package installed by default. Arch users can install it from the AUR.
Then, just add && notify-send "Done!" at the end of the command we want to execute. Assuming that the command to execute was cat:
cat file && notify-send "Done!"
A more "complex" notification system is Zenity, with which we can display dialog boxes with buttons, etc.
As with notify-send, just add && zenity –info –text = »Finished!» at the end of the command we want to execute. Assuming, once again, that the command to execute was cat:
cat file && zenity --info --text = "Long command completed."