When you're working with terminal windows, shell scripts, and background tasks, it's easy to miss what's going on - especially if you're multitasking or running long commands. That's where desktop notifications can be really helpful. This tutorial shows how to send desktop notifications using notify-send on Ubuntu.
The notify-send
is a simple command line tool that sends desktop notifications on Linux systems that support the freedesktop.org notification specification - which includes Ubuntu and many other distros.
The notify-send
utility requires only one mandatory argument: the notification summary. Here's a basic example of how to use it:
notify-send "Hello world"

To provide more details in a notification, you can add a body as the second argument; it appears below the summary in the notification.
notify-send "Summary" "Body"

You can use a few HTML tags in the notification body to add basic formatting, such as:
<b></b>
for bold<i></i>
for italic<u></u>
for underline<a></a>
for hyperlinks
notify-send "Summary" "<b>Body</b>"

With -a
option, we can specify an application name to appear in the notification:
notify-send -a "App" "Hello world"

Notifications can be assigned one of three urgency levels: critical
, normal
, or low
. To set the urgency when using the notify-send
command, simply add the -u
option followed by the desired level.
notify-send -u critical "Hello world"
Leave a Comment
Cancel reply