Solved Change Chromium Icon in Window Panel

I have installed an icon theme for XFCE and it changes _almost_ every icon.
Just Chromium refuses to change it's icon in the window list panel:
1754041087777.png

I have already created a desktop file override in ~/.local/share/applications.
The icon from that override is actually picked up in the XFCE app menu (I cannot take a screenshot of it since xfce screenshotter closes the app menu on Ok).
Anyhow in the window list, I still have the default icon.
Any ideas how I could change that icon?
I already tried to use xseticon, but it segfaults.
 
First of all thank you for x11/xseticon, I didn't know it! :)
Regarding your question:
  • xseticon works like a charm for me (I'm using MATE at the moment), so maybe it could be worth investigating.
  • The icon shown in the taskbar is probably the one supplied by Chromium itself (e.g. for Firefox these icons are located in /usr/local/lib/firefox/browser/chrome/icons/default).
 
Chromium on FreeBSD seems to use chrome.png name for it's icons, and icon theme you are using have chromium.svg iconfile for Chromium. I'd suggest copying share/applications/chromium-browser.desktop to ~/.local/share/applications and then edit the file and change the Icon= line according to the difference. Other dirty way is to overwrite Chromium's chrome.png files with your icon theme's chromium.svg iconfile under the same name chrome.png (maybe it wouldn't work cuz of the png/svg diff) (this also could get reset every update of chromium with pkg)

/usr/ports/www/chromium/pkg-plist
Code:
share/icons/hicolor/128x128/apps/chrome.png
share/icons/hicolor/22x22/apps/chrome.png
share/icons/hicolor/24x24/apps/chrome.png
share/icons/hicolor/256x256/apps/chrome.png
share/icons/hicolor/48x48/apps/chrome.png
share/icons/hicolor/64x64/apps/chrome.png
 
First of all thank you for x11/xseticon, I didn't know it! :)
Regarding your question:
  • xseticon works like a charm for me (I'm using MATE at the moment), so maybe it could be worth investigating.
  • The icon show in the taskbar is probably the one supplied by Chromium itself (e.g. for Firefox these icons are located in /usr/local/lib/firefox/browser/chrome/icons/default).
Maybe xseticon just segfaults because I am using XLibre and not Xorg. I have created a issue in the XLibre port GitHub.
I'll check if I can replace the icon in the Chromium installation under /usr/local as a hack.
 
Chromium on FreeBSD seems to use chrome.png name for it's icons, and icon theme you are using have chromium.svg iconfile for Chromium. I'd suggest copying share/applications/chromium-browser.desktop to ~/.local/share/applications and then edit the file and change the Icon= line according to the difference. Other dirty way is to overwrite Chromium's chrome.png files with your icon theme's chromium.svg iconfile under the same name chrome.png (maybe it wouldn't work cuz of the png/svg diff) (this also could get reset every update of chromium with pkg)

/usr/ports/www/chromium/pkg-plist
Code:
share/icons/hicolor/128x128/apps/chrome.png
share/icons/hicolor/22x22/apps/chrome.png
share/icons/hicolor/24x24/apps/chrome.png
share/icons/hicolor/256x256/apps/chrome.png
share/icons/hicolor/48x48/apps/chrome.png
share/icons/hicolor/64x64/apps/chrome.png
That's exactly what I did, but it only resulted in an icon change in the XFCE app menu (so obviously I somehow did it correctly).
Unfortunately the xfce-panel window switcher does not recognize that override.
 
That's exactly what I did, but it only resulted in an icon change in the XFCE app menu (so obviously I somehow did it correctly).
Unfortunately the xfce-panel window switcher does not recognize that override.
Interesting. Did you restarted xfce session since? If you go to Appearance settings of xfce and to Icons section, do you see some warning at the right of your icon theme? If so, hover over the cursor to it and read it and do the steps, then try again, maybe.
 
Interesting. Did you restarted xfce session since? If you go to Appearance settings of xfce and to Icons section, do you see some warning at the right of your icon theme? If so, hover over the cursor to it and read it and do the steps, then try again, maybe.
I actually did all of those steps. Did not help though :(
That's why I am a bit confused about what else to do. Well, currently I am searching the icons and might hard replace them.
 
Well, currently I am searching the icons and might hard replace them.
Are you going to overwrite chrome.png's with chromium.svg's ? maybe i can simplify that with
a one liner code script (you need to run with sudo or as root).

sh:
#!/bin/csh

foreach f (22 24 48 64 128 256)
    cp -i /usr/local/share/icons/hicolor/scalable/apps/chromium.svg \
            /usr/local/share/icons/hicolor/${f}x${f}/apps/chrome.png
end

my test-run of script succeeded fine.
 
Are you going to overwrite chrome.png's with chromium.svg's ? maybe i can simplify that with
a one liner code script (you need to run with sudo or as root).

sh:
#!/bin/csh

foreach f (22 24 48 64 128 256)
    cp -i /usr/local/share/icons/hicolor/scalable/apps/chromium.svg \
            /usr/local/share/icons/hicolor/${f}x${f}/apps/chrome.png
end

my test-run succeeded fine.
So it does not hurt having the svg saved under png extension?
I'll extend the script to create a chrome.png.bak before the copy and will report back.
 
So it does not hurt having the svg saved under png extension?
I don't know if it would work, anyway, If it does hurt, you wouldn't be able to see any icon at all, that means we should convert it to png first, that's OK too.

I'll extend the script to create a chrome.png.bak before the copy and will report back.
OK. Also you could do a # pkg ins -f chromium, that would reinstall the files of chromium package.
 
I don't know if it would work, anyway, If it does hurt, you wouldn't be able to see any icon at all, that means we should convert it to png first, that's OK too.


OK. Also you could do a # pkg ins -f chromium, that would reinstall the files of chromium package.
So I ran the script and in addition changed /usr/local/share/chromium/product_logo_48.png.
I have verified the images have been changed.
I still have the old icon. I even ran gtk-update-icon-cache -f -t /usr/local/share/icons/ but no result.
 
So I ran the script and in addition changed /usr/local/share/chromium/product_logo_48.png.
I have verified the images have been changed.
I still have the old icon. I even ran gtk-update-icon-cache -f -t /usr/local/share/icons/ but no result.
Very interesting. I created a boot environment to install xfce + chromium and the icon pack and try to get it working, will report back, hopefully with a success.
 
I am starting to think that Chromium developers somehow glued that original icon in the code so that it can't be changed. Did anyone got succeeded to change Chromium's original icon in the history ever? :D

I've replaced every icon of Chromium package and it is still showing the original icon. I've ran out of ideas. I've ran sysutils/lsof too to check if Chromium uses some file for it's original icon, no, it doesn't seem to use any icon file.

Yeah, it's ok in app launcher/menu as you said but no change in panel icon.
 
I am starting to think that Chromium developers somehow glued that original icon in the code so that it can't be changed. Did anyone got succeeded to change Chromium's original icon in the history? :D

I've replaced every icon of Chromium package and it is still showing the original icon. I've ran out of ideas. I've ran sysutils/lsof too to check if Chromium uses some file for it's original icon, no, it doesn't show anything...
Yeah it also is my impression they glued it in.

I will dig into the ports dir and, after make extract see if I find the icon in the work directory.
This now is a personal issue between me and chromium. 😂
 
I guess I gonna give up and life with it.
Despite the fact that I do not find the icon in the ports work directory, I don't wanna compile chromium on every update.
Annoying, but I am out of ideas 😭
 
Despite the fact that I do not find the icon in the ports work directory, I don't wanna compile chromium on every update.
Yeah, even if we found something to fix this with some code patch, we can't build it ourselves because it is a beast and depends on electron which is another beast💀
 
xseticon seems to work for me, have you tried it? I had segmentation fault too but specifying X WM class name solved it i guess or because i've used svg and now png. More testing: specifying a png and choosing a window with cursor works ( no need to specify class name ) without giving segmentation fault.
 

Attachments

  • 2025-08-01_23-58.png
    2025-08-01_23-58.png
    244.4 KB · Views: 132
xseticon seems to work for me, have you tried it? I had segmentation fault too but specifying X WM class name solved it i guess or because i've used svg and now png. More testing: specifying a png and choosing a window with cursor works ( no need to specify class name ) without giving segmentation fault.
Wow, you are my hero of the day! IT WORKS!
 
Nice! Thanks 😄. I also found a way to change the icon after chrome launches, bin/chrome is a shell script, so i edited it to run xseticon after chrome launches. Sleep is important otherwise it complains about no program found with class name. I guess you can just store the new chromium icon with png extension at somewhere like your $HOME.

Diff:
--- /usr/local/bin/chrome    2025-07-29 21:21:25.000000000 +0300
+++ chrome-patched    2025-08-02 00:09:38.384802000 +0300
@@ -22,4 +22,6 @@
     . /usr/local/share/foreign-cdm/fcdm-setup-env
 fi
 
-exec /usr/local/share/chromium/chrome ${1+"$@"}
+exec /usr/local/share/chromium/chrome ${1+"$@"} &
+
+sleep 2 ; xseticon -class Chromium-browser /usr/local/share/chromium/product_logo_48.png
 
xseticon seems to work for me, have you tried it? I had segmentation fault too but specifying X WM class name solved it i guess or because i've used svg and now png. More testing: specifying a png and choosing a window with cursor works ( no need to specify class name ) without giving segmentation fault.
FYI: I found out that xseticon -id also works if you leave away the quotation marks (in contrary to what the command's help page says).
 
Back
Top