Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-02-02 23:52:33

rfet35
Member
Registered: 2017-01-23
Posts: 21

Change icon of "Show Desktop" panel item

How to change the icon of the "show desktop" panel item? Panel version is 4.12.1

Offline

#2 2017-02-03 00:11:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: Change icon of "Show Desktop" panel item

From https://git.xfce.org/xfce/xfce4-panel/t … top.c#n107:

image = xfce_panel_image_new_from_source ("user-desktop");

It uses the icon "user-desktop". Replace this icon in your current icon theme.

Remember to "gtk-update-icon-cache </path/to/icon/theme/root>" to refresh the cache after you make any icon changes.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-02-03 00:20:50

rfet35
Member
Registered: 2017-01-23
Posts: 21

Re: Change icon of "Show Desktop" panel item

Thanks. Alternatively would it also be possible by a gtkrc user style?

Offline

#4 2017-02-03 01:24:35

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: Change icon of "Show Desktop" panel item

I'm not sure. At first glance (see section on stock images), it looks like it might be possible, but I think this would only work with gtk stock images, but user-desktop is not considered a gtk stock image.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2017-02-03 04:30:28

rfet35
Member
Registered: 2017-01-23
Posts: 21

Re: Change icon of "Show Desktop" panel item

As I was playing around with genmon I thought why not make a show desktop:

#!/bin/bash

cmd="if [ $(wmctrl -m | awk '/showing the desktop/ {print $7}') == 'OFF' ]; then wmctrl -k on; else wmctrl -k off; fi"

echo "<img>/usr/share/icons/gnome/22x22/apps/preferences-desktop-display.png</img>"
echo "<click>bash -c '$cmd'</click>"

exit 0

Now while the <click> command works, it's showing a strange behaviour:
After the 1st click (and a successful toggle) you have to wait until the "Period (s)" of genmon is over before another click will toggle the desktop again.

Running the bash command repeatedly in a shell does not show this behaviour.
Alternatively running e.g. "<click>xcalc</click>" I can start as many xcalcs as I click during "Period (s)" as expected.

genmon is v-3.4.0

Offline

#6 2017-02-03 05:21:26

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: Change icon of "Show Desktop" panel item

With genmon, your cmd is only evaluated once every period - so no matter how many times you click on it, it will always carry the same result (which is why it only works once). You are trying to use it as a toggle launcher, which it is not.

In this case, why not just create a launcher so that the if statement is executed every time you click the button?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2017-02-03 21:59:23

rfet35
Member
Registered: 2017-01-23
Posts: 21

Re: Change icon of "Show Desktop" panel item

I see. A launcher it is now.
Even if <click> was actually evaluated on the very click genmon has higher purposes. Good to know how it's doing its job though.

Offline

Board footer

Powered by FluxBB