Help customizing Xfce's NetworkManager icon when connected to VPN?

UPDATE: SOLVED

TL;DR - I want to custom my NM applet icon on main panel so that it is some super easy-to-see color when I am successfully connected to VPN. Preferably a light green. Any clue how I might do this? Failing that, is there a way to force Xfce to use symbolic icons so I can try the method in the linked guide? Or even could someone help me figure out where the public code repo for xfce network manager is located?


  • Current: this is what I have now (e.g. just the default NM icons). Seems like it is using /usr/share/icons/hicolor/22x22/apps/nm-device-wired.png for the normal eth connection and then overlaying /usr/share/icons/hicolor/22x22/apps/nm-vpn-active-lock.png on top of nm-device-wired.png once vpn is successfully connected.

  • Desired: I’m outputting my display to a TV and the current icon is hard for me to tell the difference between VPN and Not VPN at a glance. I want something that stands out more - maybe something like this custom icon from a Cinamon setup (below) or like the Windows OpenVPN client does when connected to VPN.


  • System: Fedora 39 Xfce Spin
  • Theme: fedora defaults (Settings > Appearance has “Adwaita” selected for under both Styles and Icons tabs. Settings > Window Manager > Style tab > had “Default” as the selected option under “Theme”. And my Settings > Panel Profiles > seems to be using “Xfce 4.16” - although I don’t mind the OpenSuse and Redmond profiles if I had to switch). I am open to switching themes as long as I can do a Cinnamon- or Windows-like windowing and panel layout (e.g. like a panel/“task bar” + app launcher/“start button” and the min/max/close in upper right of window instead of what mac / android / ubuntu / vanilla gnome do)

What I have tried so far:

Most all of my searches for customizing this mostly have been giving me false positives about “missing NM icon” or similar whenever I include “Xfce” in the search which is no help at all. When I just search on customizing NM icon, I did find this stackexchange post and seems to be almost exactly what I want, except that it is for Cinnamon instead of Xfce and I have no clue how to adapt it. And I guess whatever Cinnamon theme that guy is using goes for symbolic (aka black and white) icons instead of the normal ones?

I also tried searching in my /usr/share/icons but from the icons I am seeing, I can’t even tell if Xfce NM applet does images the same way. AFAICT, from the screenshots in the SE post, it almost seems like maybe Cinnamon uses completely separate icons for eth vs vpn but from what I see in Xfce is looks like it has an eth icon and when I connect to vpn, it keeps the eth icon and just overlays the lock icon on top of it? not sure. Could be wrong but to my eyes, it seems like it is using /usr/share/icons/hicolor/22x22/apps/nm-device-wired.png for the normal ethernet connection and then overlaying /usr/share/icons/hicolor/22x22/apps/nm-vpn-active-lock.png on top of nm-device-wired.png once vpn is successfully connected.

Any ideas how I might achieve this or even some things to try?


edit (2024-02-11): I haven’t had any luck experimenting or with additional searches. Since it’s been a week with no answers or even guesses, I updated the TLDR to include even asking help identifying which is the correct public code repo for xfce network manager applet (I saw several xfce ones primarily on gitlab and mirrored on github but couldn’t figure out which repo has NM applet code. Was expecting it to be under panel-plugins or apps repos but didn’t see it in either of them). Also cross-posting this on r/linuxquestions in the hopes that more eyeballs might give me some kind of lead or next step.

I am seeing that on Fedora, it appears to be a separate package from xfce (at least “xfce” is not in the package name). Does that mean that the code for NM applet itself is not desktop-specific but that xfce does its own thing theming wise (compared to the tutorial I found for changing NM icon in Cinnamon)? I also confirmed that /usr/bin/nm-applet is a compiled binary rather than a python / bash / etc script by running head -1 /usr/bin/nm-applet and getting back a bunch of gobbly gook instead of a shebang line.

# which nm-applet
/usr/bin/nm-applet
 
# dnf provides /usr/bin/nm-applet
network-manager-applet-1.32.0-2.fc39.x86_64 : A network control and status applet for NetworkManager
Repo        : fedora
Matched from:
Filename    : /usr/bin/nm-applet
 
network-manager-applet-1.34.0-1.fc39.x86_64 : A network control and status applet for NetworkManager
Repo        : @System
Matched from:
Filename    : /usr/bin/nm-applet
 
network-manager-applet-1.34.0-1.fc39.x86_64 : A network control and status applet for NetworkManager
Repo        : updates
Matched from:
Filename    : /usr/bin/nm-applet

Edit 2:

Since it is working now after TabsBelow’s suggestion, I have updated top of the post to “SOLVED” and changed flair from Question to Theme (didn’t see a flair for “Solved”).

Why don’t you just edit the PNG files with GIMP?

I feel like a massive idiot rn lol…

I somehow had it in my mind that since there was an overlay on the second image that this would not work. But you’re absolutely right, if I completely give up on doing things the vanilla way and edit nm-vpn-active-lock.png so that it is a customized nm-device-wired.png w green monitor + merged layer w the lock icon and save it as nm-device-wired.png, it works great.

Just tested it by creating ~/.local/share/icons/hicolor/22x22/apps and copying the two (modified) files there: so now I have a nm-device-wired.png w an orange monitor and a nm-vpn-active-lock.png that has a green monitor and a lock.

Only disadvantage of doing it this way I guess would be if you were wanting to have 2 completely different icons (e.g. shape not just color) and the lock icon wouldn’t completely cover up the regular one (e.g. like the ones in the stackexhange screenshot) but I am completely happy with having any way to get it working, so thanks !

Somewhere in the themes folder you also should find a reference to these two icons, so you can also change that.
It was too late when I write the post above.

oh that’s good to know too. thank you

Learn how to use the “find” command for this purpose.

catfish file search works too

The more people know how to find, the more I can ask for the syntax🤭

Indeed. When I’m alone, I use history so I don’t have to look it up every three months or so. Guess I simply learned too many different types of batch languages and their parameters in the last 40 years, I can’t memorize parms I don’t use regularly.

i generally prefer cli over gui except find even though find is usually faster than the gui alternatives I hate the syntax so much

That one of the reasons… It seems some kind of perverted to me, I guess it just was improved, changed, and extended by too many people over a much too long time.

My generic expectation is always

command (source (destination)) -how (-and (-extras))