Skip to content

Send notifications with notify send

Send notifications with notify-send

Simple Notification

notify-send 'Title' 'Text of the message'
053d3db23dbcf4a01818559011275831.png

Fig: Simple desktop notification

Notification with an icon

notify-send can be used to send notification with an icon using -i option

notify-send -u critical -i "firefox" 'Title' 'Text of the message'

ed8790a1fa6d2091b89bb526c9a34b2b.png

Notification with custom icon

You can use your own custom icon using the notify-send -i option as shown below.

notify-send -i ~/test/java.png 'Hello World!!'

8ed8dd6c92302374951d7609b706de50.png

Notification with output of command

notify-send 'ls example' "`ls /boot`"
b298203f5f85483e1cadbcea104cdc80.png

Notification after command execution

To notify only if the command execution succeeds, use &&.

command && notify-send

To notify after a command (or shell-script, or background job) is completed, without worrying whether the commands succeeded or failed use ;.

long job ; notify-send

This method is extremely helpful when you are executing a long running shell-script in the background and you would like to be notified with a little nice non-intrusive pop-up when the job is completed.

Urgency level

You can specify an urgency level with -u or --urgency=LEVEL. Levels can be used: - low - normal - critical

Expire time

Set the timeout in milliseconds at which to expire the notification using -t or --expire-time=TIME


Source 1 Source 2