notify-send

A program to send desktop notifications, inform the user about an event or display some form of information without getting in the user’s way.

Syntax 
      notify-send [OPTIONS] summary [body]
 
Key
   -a, --app-name=APP_NAME
               Specifies the app name for the notification.

   -A, --action=[NAME=]Text...
               Specifies the actions to display to the user.
               Implies --wait to wait for user input.
               May be set multiple times. The NAME of the action is output to stdout.
               If NAME is not specified, the numerical index of the option is used (starting with 1).

   -e, --transient
               Show a transient notification.
               Transient notifications by-pass the server's persistence capability, if any.
               And so it won't be preserved until the user acknowledges it.

   -i, --icon=ICON[,ICON...]
               An icon filename or stock icon to display.
               The default icon is blue for low and normal notifications and red for critical.

   -p, --print-id
               Print the notification ID.

   -r, --replace-id=REPLACE_ID
               The ID of the notification to replace.

   -t, --expire-time=TIME
               The duration, in milliseconds, for the notification to appear on screen.
               Not all implementations use this parameter. GNOME Shell and Notify OSD always
               ignore it, while Plasma ignores it for notifications with the critical urgency level.

   -u, --urgency=LEVEL
               The urgency level (low,  normal,  critical).
               Critical notifications will not automatically disappear after a timeout.

   -w, --wait
               Wait for the notification to be closed before exiting.
               If the expire-time is set, it will be used as the maximum waiting time.

   -c, --category=TYPE[,TYPE...]
               The notification category type:

              "device"         A generic device-related notification.
              "device.added"   A device, such as a USB device, was added to the system.
              "device.error"   A device had some kind of error.
              "device.removed" A device, such as a USB device, was removed from the system.
              "email"          A generic email-related notification
              "email.arrived"  A new email notification.
              "email.bounced"  A notification stating that an email has bounced.
              "im"             A generic instant message-related notification.
              "im.error"       An instant message error notification.
              "im.received"    A received instant message notification.
              "network"        A generic network notification.
              "network.connected"
                               A network connection notification, such as successful sign-on
                               to a network service. This should not be confused with
                               "device.added" for new network devices.
              "network.disconnected"
                               A network disconnected notification.
                               This should not be confused with "device.removed" for
                               disconnected network devices.
              "network.error"  A network-related or connection-related error.
              "presence"       A generic presence change notification, such as going away or idle.
              "presence.offline"   An offline presence change notification.
              "presence.online"    An online presence change notification.
              "transfer"           Generic file transfer or download notification.
              "transfer.complete"  File transfer or download complete.
              "transfer.error"     File transfer or download error.

   -?, --help
               Show a help message
 
   -h, --hint=TYPE:NAME:VALUE
               Pass extra data. Valid TYPEs are BOOLEAN, INT, DOUBLE, STRING, BYTE and VARIANT.

Standard hints

Name Value Type Description
"urgency" byte The urgency level.
"category" string The type of notification this is.
"desktop-entry" string This specifies the name of the desktop filename representing the calling program. This should be the same as the prefix used for the application's .desktop file. An example would be "rhythmbox" from "rhythmbox.desktop". This can be used by the daemon to retrieve the correct icon for the application, for logging purposes, etc.
"image_data" (iiibiiay) This is a raw data image format which describes the width, height, rowstride, has alpha, bits per sample,channels and image data respectively. We use this value if the icon field is left blank.
"sound-file" string The path to a sound file to play when the notification pops up.
"suppress-sound" boolean Causes the server to suppress playing any sounds, if it has that ability. This is usually set when the client itself is going to play its own sound.
"x" int Specifies the X location on the screen that the notification should point to. The "y" hint must also be specified.
"y" int Specifies the Y location on the screen that the notification should point to. The "x" hint must also be specified.

Add newlines to the message body by using the \n escape sequence.

Notifications should be used very sparingly or they will be ignored.

Installation

To use notify-send, you may need to install the following package:

$ sudo apt-get install libnotify-bin
or
$ sudo apt install notify-osd

Source: https://gitlab.gnome.org/GNOME/libnotify

The return status is zero if all information was written successfully.

Examples

Send a basic message:

$ notify-send 'Quick message' "Hello World"

Send a low priority message that will appear for 5 seconds:

$ notify-send -t 5000 -u low 'Another message' "Hello World"

Send a critical notification that does not automatically disappear after a timeout. Click the message to remove it:

$ notify-send -u critical 'Hey' "This is important"

Send a message with an icon:

$ notify-send -i ~/windevcluster.png 'This is a longer alert' "It can include\nseveral lines\nof text"

Send a message with a URL:

$ notify-send -i ~/icon.png 'Something happened' 'Try looking here\nhttp://windevcluster.com'

“Those who know, do not speak. Those who speak, do not know” ~ The Tao

Related Linux commands

echo - Display message on screen.


 
Copyright © 1999-2025 windevcluster.com
Some rights reserved