Xfce: how to properly replace the Chromium's icon?

I’d wish to change the Chromium’s icon, not only in the Whisker’s menu, but also in the Xfce’s panel.

To change it in the Whisker’s menu, I edited the .desktop file ~/.local/share/applications/chromium.desktop
Indicating, in the Icon= section, the path to my icon, and worked as expected.

But I cannot figure out how to change it also as appear in the Xfce’s panel.
So I see that the Chromium package, place its icons to:

/usr/share/icons/hicolor/128x128/apps/chromium.png
/usr/share/icons/hicolor/16x16/apps/chromium.png
/usr/share/icons/hicolor/24x24/apps/chromium.png
/usr/share/icons/hicolor/256x256/apps/chromium.png
/usr/share/icons/hicolor/32x32/apps/chromium.png
/usr/share/icons/hicolor/48x48/apps/chromium.png
/usr/share/icons/hicolor/64x64/apps/chromium.png

And I replace them whit my icons (obviously with the proper size for each folder), but in the Xfce’s panel, still appears the default icon.
I also replaced the icons in every folders of my icon theme:
/usr/share/icons/Flat-Remix-Yellow-Dark
I also executed sudo gtk-update-icon-cache /usr/share/icons/Flat-Remix-Yellow-Dark/

But still, is not enough. I miss something? Where is located such icon?

2020-11-30_18-52

Try changing the desktop file in /usr/share/applications/.

If that does the trick, you’ll have to change it every time Chromium pushes an update though…

:sob:

I also tried to edit such file, but the icon on the panel and also in the task manager, remains the same, not the one which I made.
About the .desktop file, this only change the icon on Desktop, in Whisker Menu and inside the folders.

Did you log off and log back on after the change?

:+1:

Sure: I alsot rebooted and cleaned the thumbnails cache.

I’m all out of bright ideas then! (also running on KDE where that just works)

:sob:

So, you successfully change its icon?
If so, when you run Chromium and execute the task manager, do you see your icon?

This is what I mean: not only about the Panel:

Well, in such situation, a trick would be use incrond with this entry in his incrontab:

/usr/share/applications/chromium.desktop IN_MODIFY sed -i 's/Chromium.png/MyIcon.png/g'

:grin:

1 Like

If you want to change the icon of a launcher you created for Chromium in the panel:
right-click on the launcher > Properties > click on the Edit icon in the right side > select a different icon in the option Icon.


If you want to change the icon used by the Window Buttons item in the panel for Chromium, try the script from these Xfce Forum threads:
https://forum.xfce.org/viewtopic.php?id=11561
https://forum.xfce.org/viewtopic.php?id=10845

This script will change (with a small delay - see the WAIT reference in the script) the icon used by the Window Manager for Chromium, which means that the Task Manager will also use the icon defined by the script.

You will need the package xseticon from the AUR for the script to work (it installs just fine without any needs for modification). Also, notice that the script only supports .png files for the icon.

Using the script, you should change the icon when Chromium is invoked from the command line.
To change the icon of Chromium when it gets launched from the menu or from a desktop shortcut, copy the .desktop file of Chromium to the ~/.local/share/applications directory

cp /usr/share/applications/chromium.desktop ~/.local/share/applications/

Open the file you just copied in the ~/.local/share/applications directory with a text editor and modify the line(s) beginning with Exec, using the full path to the script (for example it can be placed in /usr/local/bin/ as mentioned in the linked threads).

You might need to logout/login for the changes to have effect.

1 Like

This is what I done in the Whisker menu:
Screenshot_2020-12-06_12-35-13

In the Xfce’s panel, the icon is just minimized, is not a shortcut:
Screenshot_2020-12-06_12-36-30

With Firefox, eg, I have been able to change its icon globally by placing the icon under my icon theme in /usr/share/icons/Flat-Remix-Yellow-Dark/apps/scalable/firefox.svg: the same which I attempted to do with Chromium, but after a better research I found out that its icon is embedded in a library (*.so file).

However I will try the suggestion which you linked, thanks.