Conditions for the icon for notify-send -i
Asked Answered
A

2

15

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).

Assam answered 8/9, 2016 at 7:6 Comment(0)
J
20

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"
Judaea answered 8/9, 2016 at 7:13 Comment(0)
X
3

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

Xylene answered 31/7, 2023 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.