Add Desktop Notifications to Shell Scripts with notify-send
Productivity Sauce
Monitoring a running shell script usually means keeping an eye on the terminal window. Obviously, that's not the most productive way to spend your time, so instead of staring at the terminal, you can equip shell scripts with desktop notifications that give you visual feedback when specific events occur. One possible solution is to use the notify-send command which is part of the libnotify package. To install it on Debian or Ubuntu, run the apt-get install libnotify-bin command as root. Using notify-send couldn't be easier. Simply add the command followed by the message text in the desired place in the script as follows:
notify-send "Hello world!"
The command supports a few parameters that can be used to specify the urgency level, expiration time, category, and icon. To view all the supported options along with their descriptions and usage, run the notify-send -? command.
comments powered by DisqusIssue 206/2018
Buy this issue as a PDF
News
-
LibreOffice Based CODE 3.0 Released
You can now run the latest version of LibreOffice Online in your own cloud.
-
Google Announces Kubeflow to Bring Kubernetes to Machine Learning
The fully open source project is designed to help engineers build a machine learning stack using Kubernetes.
-
KubeCon Concluded in Austin, Texas
The Kubernetes community gathered in Austin, Texas.
-
Dell to Disable Intel’s Insecure IME
Dell responds to the reports of critical vulnerabilities in the Intel vPro Management Engine.
-
Linus Torvalds’ Precious Advice to Security Experts
Torvalds said that developers should focus more on debugging than resorting to fallback mode.
-
GPLv3 Comes to the Rescue of GPL Violators
Red Hat adopts GPLv3 cure provisions to help companies fix GPL violations.
-
Linux Kernel 4.14 Released
Torvalds lashes out at a Canonical developer who introduced a regression.
-
Fedora 27 Is Released
Developers can now access Red Hat Enterprise Linux Developer subscriptions on Fedora 27 at no cost.
-
Samsung to Bring Linux to the Galaxy Phone
Samsung is testing Linux desktop for its DeX experience.
-
System76 Releases Pop!_OS
An Ubuntu-based operating system designed for professionals.
