Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-07-30 14:34:00

callmejoe
Member
Registered: 2019-11-19
Posts: 49

[solved] change status tray icons on panel

is there any way to change the status tray icons to other than the theme default?

I am trying to change the bluetooth and volume icons

bAHhsAhl.png

Last edited by callmejoe (2022-08-01 15:52:39)

Offline

#2 2022-07-30 15:44:11

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,085

Re: [solved] change status tray icons on panel

Some apps will use hard-coded tray icons and others will look for specific named ones from the current icon theme. Which bluetooth app is that  (blueman-applet?) and volume app (pulseaudio plugin?)

For example, the pulseaudio plugin uses the icons named audio-volume-*.

Also, which icon theme are you using?

Online

#3 2022-07-30 23:03:50

callmejoe
Member
Registered: 2019-11-19
Posts: 49

Re: [solved] change status tray icons on panel

blueman-applet and the volume is from pasystray

i am using the adwaita icon theme.

Some apps will use hard-coded tray icons

so no way to change these?

others will look for specific named ones from the current icon theme

and how does it know where to look?  so many folders with icons.  i guess there is a standard?
t31D19Ul.png

Offline

#4 2022-07-31 03:54:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,085

Re: [solved] change status tray icons on panel

pasystray is going to use the following icon prefixes:

static icon_set_t volume_icon_names = {
    [ICON_IDX_MUTED] = "audio-volume-muted",
    [ICON_IDX_LOW] = "audio-volume-low",
    [ICON_IDX_MEDIUM] = "audio-volume-medium",
    [ICON_IDX_HIGH] = "audio-volume-high"
};

Depending on the version of the Adwaita icon theme you are using, these icons should be located in the *x*/status folder (but may also have one or more "symbolic" tagged on.

The Blueman applet should use the blueman-tray-{active,disabled,paired} icons. The code is somewhat difficult to figure out.

Unfortunately, its quite the adventure trying to find a way to replace them.

Online

#5 2022-07-31 05:08:00

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

callmejoe wrote:

so no way to change these?

Hard-coded would mean that there isn't a way apart from modifying the source and recompiling.

You can easily find out which icons are currently in use with GTK Inspector:
eWoJbIRl.png

Activate a plug-in, hover over any of its elements and press Ctrl+Shift+i. Note down which state uses which icon, then create a symbolic link to the preferred ones from them.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#6 2022-07-31 10:36:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,085

Re: [solved] change status tray icons on panel

@kbar, Unfortunately, that doesn't work for me for any systray/notifier items. They all show as NULL.

Online

#7 2022-07-31 12:38:47

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

My apologies, I did not test it for systray icons. However, sn items (even inside the new combined systray) should have this property set, you just have to select the second/last child element, like so (redshift-gtk):
vv9D34Vs.png
KUJrUdrl.png
sdabwW8l.png

Can you name a few others? I'd like to look into them. Thanks.

Last edited by KBar (2022-07-31 12:41:07)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#8 2022-07-31 12:58:20

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

Alright, I installed the pasystray package on Debian sid and it displays the icon-name propertly (second/last GtkImage element). It also shows it on icon hover. Do you get the same behavior?
Y486CnWl.png
I0rrKm2l.png

Edit: regarding the question itself.

You can try copying your current icon theme to ~/.icons to prevent your package manager from overwriting local changes. Next, you may replace the icons for each state with the ones you prefer. For example, from the screenshot above it's set to audio-volume-medium-symbolic.

find ~/.icons/Adwaita -name 'audio-volume-medium-symbolic*'

will print list all of the theme icons for medium audio volume. You don't have to replace all of the sizes, just the ones that your panel uses. The icon size should be equal to the one you set in systray properties. The pixel-size property should also tell you about this.

After replacing the icons:

Xfce wiki wrote:

Optional: run

gtk-update-icon-cache -f -t ~/.icons/<theme_name>

to create an icon cache

The end result after I copied an icon for the medium volume state from the Ubuntu mono theme to ~/.icons/Adwaita/scalable/status/audio-volume-medium-symbolic.svg:
0IASl8gl.png
Just for funsies:
EjQeajBl.png

Last edited by KBar (2022-07-31 13:52:12)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#9 2022-07-31 16:01:33

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,085

Re: [solved] change status tray icons on panel

Do you get the same behavior?

I'm on arch and no I don't. Hovering over the icon and Ctrl+Shift+I brings up the xfdesktop inspector. I have to click on the icon first then bring up the inspector. Icon name is always NULL. Its been like this for me for a while now. I wonder what the difference is between the two? It would be nice to be able to get the name of the icon being used without having to look it up in the code.

Online

#10 2022-07-31 18:47:07

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

ToZ wrote:

Hovering over the icon and Ctrl+Shift+I brings up the xfdesktop inspector.

What I meant is that pasystray itself displays icon-name on hover, which is rather strange, but incidentally helpful in this case.

I wonder what the difference is between the two? It would be nice to be able to get the name of the icon being used without having to look it up in the code.

I'm probably wrong but it looks like that one GtkImage widget is created for the icon itself and the other for something called "overlay icon" (not/never/rarely? used).

  box->icon = gtk_image_new ();
  gtk_widget_set_parent (box->icon, GTK_WIDGET (box));
  gtk_widget_show (box->icon);

  box->overlay = gtk_image_new ();
  gtk_widget_set_parent (box->overlay, GTK_WIDGET (box));
  gtk_widget_show (box->overlay);

Systray's code looks too "raw" (as in yet to be finished) to me. As far as I can tell, for systray items a GtkImage is never created explicitly, so they get none of its properties. I'll play with it in gdb this week and see what I can find. Hopefully, a patch. big_smile

As for blueman, I blacklisted all Bluetooth modules a while ago. It took a lot of tinkering, so I wouldn't want to touch it. Can you identify whether it runs inside systray or statusnotifier? Thanks.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#11 2022-08-01 02:15:12

callmejoe
Member
Registered: 2019-11-19
Posts: 49

Re: [solved] change status tray icons on panel

wow. way more involved than i had hoped.  i was thinking changing these status tray icons was as easy as changing a .desktop launcher icon.  but it seems it is not that easy.

this from KBar sounds like the right approach

You can try copying your current icon theme to ~/.icons to prevent your package manager from overwriting local changes. Next, you may replace the icons for each state with the ones you prefer. For example, from the screenshot above it's set to audio-volume-medium-symbolic.

still not sure how to choose the correct size directory. my systray is set to adjust icon size automatically, not a fixed size.
t31D19Ul.png

Last edited by callmejoe (2022-08-01 02:51:28)

Offline

#12 2022-08-01 03:19:04

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

callmejoe wrote:

but it seems it is not that easy.

Well, it's easy. It's just finding the right icons is a bit involved like you said.

still not sure how to choose the correct size directory. my systray is set to adjust icon size automatically, not a fixed size.

Even if it's set to adjust automatically, you can rule out huge ones. Do you change the panel width constantly? I doubt it. Do you set your panel to occupy half of your screen? I doubt it. Unlike GtkImage properties, GTK Inspector still has the allocation size:
isM1yAEl.png
If I enable automatic adjustment, the icons shrink down to 16px and allocation updates instantly.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#13 2022-08-01 03:34:01

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

Looks like it's a 32px one. You can verify by looking at all of the available icons:

find /usr/share/icons/Adwaita/ -name '*audio*' -exec ristretto {} +

Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#14 2022-08-01 05:41:42

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

Systray items are drawn by Cairo. Not sure if cairo_t contains data like icon name and size. It probably cannot be exposed directly, but the Resources tab lists all icons to be used:
UExYJtQl.png
I guess with a bit of a detective work, you can find which icons are being used, but in no way this is easy (can't preview selected icons, some are not shown). At least, you don't have to wander around the source code.

Last edited by KBar (2022-08-01 05:57:09)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#15 2022-08-01 11:56:55

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 9,085

Re: [solved] change status tray icons on panel

KBar wrote:

As for blueman, I blacklisted all Bluetooth modules a while ago. It took a lot of tinkering, so I wouldn't want to touch it. Can you identify whether it runs inside systray or statusnotifier? Thanks.

StatusNotifier. The icon being used isn't identified in the Inspector.

Online

#16 2022-08-01 13:27:30

KBar
Moderator
Registered: 2021-11-05
Posts: 547

Re: [solved] change status tray icons on panel

Alright, I enabled my Bluetooth again just to test this in a Debian VM. The icon-name property is shown as expected:
TIJnTaNl.png

Available by selecting the second GtkImage element:
Kdk3QtWl.png

blueman-tray icons are provided by blueman:

find /usr/share/icons/ -name '*blueman-*' 
/usr/share/icons/hicolor/24x24/status/blueman-active.png
/usr/share/icons/hicolor/24x24/status/blueman-tray.png
/usr/share/icons/hicolor/24x24/status/blueman-disabled.png
/usr/share/icons/hicolor/128x128/status/blueman-active.png
/usr/share/icons/hicolor/128x128/status/blueman-tray.png
/usr/share/icons/hicolor/128x128/status/blueman-disabled.png
/usr/share/icons/hicolor/22x22/status/blueman-active.png
/usr/share/icons/hicolor/22x22/status/blueman-tray.png
/usr/share/icons/hicolor/22x22/status/blueman-disabled.png
/usr/share/icons/hicolor/48x48/status/blueman-active.png
/usr/share/icons/hicolor/48x48/status/blueman-disabled.png
/usr/share/icons/hicolor/192x192/status/blueman-active.png
/usr/share/icons/hicolor/192x192/status/blueman-tray.png
/usr/share/icons/hicolor/192x192/status/blueman-disabled.png
/usr/share/icons/hicolor/72x72/status/blueman-active.png
/usr/share/icons/hicolor/72x72/status/blueman-tray.png
/usr/share/icons/hicolor/72x72/status/blueman-disabled.png
/usr/share/icons/hicolor/64x64/status/blueman-active.png
/usr/share/icons/hicolor/64x64/status/blueman-tray.png
/usr/share/icons/hicolor/64x64/status/blueman-disabled.png
/usr/share/icons/hicolor/16x16/status/blueman-down-active.png
/usr/share/icons/hicolor/16x16/status/blueman-active.png
/usr/share/icons/hicolor/16x16/status/blueman-up-active.png
/usr/share/icons/hicolor/16x16/status/blueman-tray.png
/usr/share/icons/hicolor/16x16/status/blueman-down-inactive.png
/usr/share/icons/hicolor/16x16/status/blueman-up-inactive.png
/usr/share/icons/hicolor/16x16/status/blueman-disabled.png
/usr/share/icons/hicolor/16x16/devices/blueman-device.png
/usr/share/icons/hicolor/32x32/status/blueman-down-active.png
/usr/share/icons/hicolor/32x32/status/blueman-active.png
/usr/share/icons/hicolor/32x32/status/blueman-up-active.png
/usr/share/icons/hicolor/32x32/status/blueman-tray.png
/usr/share/icons/hicolor/32x32/status/blueman-down-inactive.png
/usr/share/icons/hicolor/32x32/status/blueman-up-inactive.png
/usr/share/icons/hicolor/32x32/status/blueman-disabled.png
/usr/share/icons/hicolor/256x256/status/blueman-active.png
/usr/share/icons/hicolor/256x256/status/blueman-tray.png
/usr/share/icons/hicolor/256x256/status/blueman-disabled.png
/usr/share/icons/hicolor/scalable/emblems/blueman-trusted-emblem.svg
/usr/share/icons/hicolor/scalable/emblems/blueman-paired-emblem.svg
/usr/share/icons/hicolor/scalable/emblems/blueman-blocked-emblem.svg
/usr/share/icons/hicolor/scalable/actions/blueman-trust-symbolic.svg
/usr/share/icons/hicolor/scalable/actions/blueman-pair-symbolic.svg
/usr/share/icons/hicolor/scalable/actions/blueman-block-symbolic.svg
/usr/share/icons/hicolor/scalable/actions/blueman-untrust-symbolic.svg
/usr/share/icons/hicolor/scalable/actions/blueman-send-symbolic.svg
/usr/share/icons/hicolor/scalable/status/blueman-symbolic.svg
/usr/share/icons/hicolor/scalable/status/blueman-active.svg
/usr/share/icons/hicolor/scalable/status/blueman-tray-symbolic.svg
/usr/share/icons/hicolor/scalable/status/blueman-disabled.svg
/usr/share/icons/hicolor/scalable/status/blueman-x.svg
/usr/share/icons/hicolor/scalable/status/blueman-active-symbolic.svg
/usr/share/icons/hicolor/scalable/status/blueman-disabled-symbolic.svg
/usr/share/icons/hicolor/scalable/status/blueman-tray.svg
/usr/share/icons/hicolor/scalable/devices/blueman-serial.svg
/usr/share/icons/hicolor/scalable/devices/blueman-device.svg
/usr/share/icons/hicolor/96x96/status/blueman-active.png
/usr/share/icons/hicolor/96x96/status/blueman-tray.png
/usr/share/icons/hicolor/96x96/status/blueman-disabled.png

callmejoe, please let me know after you change icons, as I'd like to disable my Bluetooth again. For now, I'm going to keep it on just in case.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#17 2022-08-01 15:36:21

callmejoe
Member
Registered: 2019-11-19
Posts: 49

Re: [solved] change status tray icons on panel

thanks KBar I got it all sorted out.  a little trial and error, but not too bad. 

But like ToZ i still get null as the icon name with the gtk inspector.

Offline

Board footer

Powered by FluxBB