In Linux-based operating systems, user interaction is not limited to the terminal; desktop notifications offer a discreet and effective way to report important events without interrupting workflow. The news-send command, part of the libnotify package, allows to generate these notifications directly from the command line or from scripts, which is invaluable for system administrators, developers and any user who wants to keep abreast of background processes.
n
What's news?
Notify-send is a command line utility that is part of the libnotify project, designed to send notifications to the desktop notification server, such as the one using GNOME, KDE, XFCE or GTK-based environments. No superuser privileges required and run with basic syntaxnotify-send [opciones] 'título' 'mensaje'. When invoked, the notification demon shows a temporary pop-up window in the top right corner (or according to the theme settings) that disappears after a few seconds or when clicking.
n
Installation and compatibility
In most Linux distributions, news-send comes pre-installed as part of the packagelibnotify-bin(in Debian / Ubuntu) orlibnotify(in Fedora, CentOS). If for any reason it is missing, it is sufficient to install it by the relevant package manager:sudo apt-get install libnotify-bin, sudo dnf install libnotifyorsudo pacman -S libnotify. The command depends only on the desktop notification demon, so it works in environments such as GNOME Shell, KDE Plasma, XFCE, LXQt and light notification managers such as dunst or mako. No additional libraries or root privileges are required to run, making it ideal for user scripts and automated tasks.
n
Basic syntax and most used options
The command accepts several lags that modify the performance of the notification. Some of the most common options are:
-uor--urgency: sets the level of urgency (low, normal, critical).-tor--expire-time: defines the time in milliseconds that the notification will remain visible (0 to remain until the user closes).-ior--icon: indicates the path to an icon or the name of a thematic icon that will be displayed next to the message.-cor--category: assigns a category (device, email, im, error, etc.) that some environments use to filter or group notifications.
A simple example would be:
notify-send 'Actualización completada' 'El sistema ha instalado las últimas actualizaciones de seguridad' -u normal -t 5000 -i dialog-information
n
Cases of practical use
Desktop notifications are especially useful in scenarios where you need to inform the user without forcing him to change the window. Some common examples include:
- Long task completion alerts: after compiling a project, running a backup or downloading a large file, you can release
notify-send 'Compilación finalizada' 'El binario está listo para probarse' -u low. - Event reminders: a cron script can warn ten minutes before a scheduled meeting with
notify-send 'Reunión en 10 min' 'No olvides preparar la presentación' -u critical -t 60000. - Service monitoring: a daemon that verifies the status of a web server can report loss or recovery by
notify-send 'Servidor web caído' 'Revisar los logs inmediatamente' -u critical -i dialog-error. - File changes Notifications: tools like
inotifywaitcan be piled to news-send to alert when a major configuration file is modified.
These examples show how the integration of news-send into scripts and automated workflows improves productivity and reduces the likelihood of overlooked critical events.
n
Advanced tips and tricks
To make the most of news, take these recommendations into account:
- Avoid overloading the user: use appropriate emergency levels and limit exposure time with
-twhen the information is not critical. - It supports thematic icons: many environments include standard icons such as
dialog-information,dialog-warningordialog-errorthat are adapted to the current theme. - Combine with other tools: you can use
sshto send notifications from a remote server provided the notification demon is active in the local session (e.g. byDISPLAY=:0 notify-send ...). - It easily depresses: if the notification does not appear, check that the notification service is running with
ps -ef | grep notification-daemonor restart the service of your desktop environment. - Customize the format: although notify-send does not allow you to change sources or colors directly, some notification managers (such as dunst) allow you to configure styles using external configuration files.
With these tricks, you will be able to integrate notifications in an elegant and professional way in any Linux environment.
n
Conclusion
The news-send command is a simple but powerful tool that sets the gap between the command line and the desktop experience. Its ability to deliver timely information without interrupting the workflow makes it an indispensable ally for day-to-day administrators, developers and users. By mastering your syntax, options and best practices, you can transform any script or process into a visual feedback source that improves system efficiency and awareness.


