Shayan
Shayan

Reputation: 409

Conditions for the icon for notify-send -i

I tried to send a notification (in Ubuntu 16.04) with an icon.

  -i, --icon=ICON[,ICON...]         Specifies an icon filename or stock icon to display.

Is there any condition for the icon to be shown?

I have an icon on my desktop "image.png"; But when i try this command :

notify-send "message" -i Desktop/USERNAME/image.png

It doesn't show the icon. (It just shows the message)

But, when i try :

 notify-send "Message" -i /usr/share/pixmaps/gksu.png 

It shows the icon and the message.

What's the difference between those two icons? they have the same type (png), also both of them are square (N x N).

Upvotes: 16

Views: 14392

Answers (2)

Sefer
Sefer

Reputation: 41

The conditions for the icon are specify in "freedesktop icon-theme-spec", you can read here:

https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout

  • So, the icon MUST be in some of this folders:

HOME/.icons

/usr/share/icons

/usr/share/pixmaps

...Then it can be invoqued using file name without extension, o full path (with extension):

-i alert

-i /home/user/.icons/alert.png

Upvotes: 4

redneb
redneb

Reputation: 23920

Try using the absolute path of the icon, i.e.:

notify-send "message" --icon="~/Desktop/USERNAME/image.png"

or

notify-send "message" --icon="$HOME/Desktop/USERNAME/image.png"

Upvotes: 21

Related Questions