xeyownt / xseticon

xseticon from Paul Evans -- http://www.leonerd.org.uk/
GNU General Public License v2.0
32 stars 11 forks source link

Result seems OK but icon is not set #16

Open ricciolino opened 1 month ago

ricciolino commented 1 month ago

image

I just want to substitute the default "gnome-terminal" icon with a custom PNG...

I am executing this

./xseticon -id 0x08208e70 /home/ricciolino/.local/share/pixmaps/dmesg.png

Result seems ok .... but icon of gnome-terminal is not changed...

image

Why this ?

xeyownt commented 1 month ago

Strange indeed.

Just tried on my Debian Bookworm and it doesn't work either.

Maybe icon management changed in recent distributions.

ricciolino commented 1 month ago

As a workaround I was able to implement the following trick (e.g. launching a gnome-terminal instance from a *.desktop launcher file):

[Desktop Entry]
Name=Live Dmesg
Exec=gnome-terminal --title="Live dmesg" -- bash -c "echo \"Opening dmesg...\"; sleep 0.3; xdotool search --name \"Live dmesg\" set_window --class \"LiveDmesgClass\"; sleep 0.3; sudo dmesg -w"
Icon=/home/ricciolino/.local/share/pixmaps/dmesg.png
Type=Application
StartupNotify=true
StartupWMClass=LiveDmesgClass

As you can see in the "Exec" field, by using the xdotool tool, I am forcing the just opened terminal instance to set its WMClass to match the StartupWMClass launcher property. Doing so, the launcher icon will match the window icon shown in the "workspace view" and "Alt+Tab switcher view" specified by "Icon" property /home/ricciolino/.local/share/pixmaps/dmesg.png.

--> App search view: image

--> Workspace view: image