How to find and modify application icon

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
eatingpanda
Level 1
Level 1
Posts: 47
Joined: Thu Feb 27, 2020 5:32 am

How to find and modify application icon

Post by eatingpanda »

I've been installing several themes and icons on my computer (Linux Mint 20 XFCE, 64-bit) and have been using the Plank dock for a while now.
Right now I'm using the Arc theme (https://github.com/horst3180/Arc-theme) and the Tela icons (https://github.com/vinceliuice/Tela-icon-theme).
For some of the applications in my plank dock (e.g. LMMS, https://lmms.io) there is no icon in the Tela icon set, so instead of a round LMMS icon, there is a square one.

So I'm wondering, how does Linux Mint select the icons used in, for example, Plank?
I've looked in to many folders to find the LMMS icon being used and think I found it in /usr/share/icons/hicolor/scalable/apps/lmms.svg. However, I found the desktop launcher for LMMS in /usr/share/applications/lmms.desktop which seems to have the same icon as in the Whisker menu.
The file looks as follows

Code: Select all

[Desktop Entry]
Name=LMMS
GenericName=Music production suite
GenericName[ca]=Programari de producció musical
GenericName[de]=Software zur Musik-Produktion
GenericName[fr]=Suite de production musicale
Comment=Music sequencer and synthesizer
Comment[ca]=Producció fàcil de música per a tothom!
Comment[fr]=Séquenceur et synthétiseur de musique
Icon=lmms
Exec=lmms %f
Terminal=false
Type=Application
Categories=Qt;AudioVideo;Audio;Midi;
MimeType=application/x-lmms-project;
I stumbled across some other LMMS icons on my computer at different locations, so I'd be interested to know how Linux Mint knows what icon to use?
And instead of modifying the /usr/share/icons/hicolor/scalable/apps/lmms.svg file, I'd like to know if I could "override" this behaviour and, for example, add a new icon in ~/.icons and have my system use this one instead? Because I probably will not be able to find the icons that my system uses each and everytime I'd like to modify it.

I also tried to add a new, modified icon at the folder in which the Tela icons are stored (.local/share/icons/Tela-circle/scalable/apps/), but that didn't change the icon in my Plank dock and after logging off and back on again, my dock just wouldn't start.

Hopefully I'm making some sense.

Thank you all!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
diapason
Level 4
Level 4
Posts: 378
Joined: Mon Apr 09, 2018 5:31 pm
Location: Montevideo, Uruguay

Re: How to find and modify application icon

Post by diapason »

I can't help you specifically with XFCE as I have never used it but in the Cinnamon desktop you can change the application icons quite easily by using the menu editor. I expect XFCE has a similar option somewhere. If none of the many onboard icons available are to your liking, you can download alternatives from the web. There are quite a few sites, for example, this one: https://helpdeskgeek.com/linux-tips/how ... -in-linux/

Whether using a Plank dock has any bearing I can't say. Have you looked here?: https://www.linuxuprising.com/2019/12/a ... linux.html
diapason
Linux Mint 21.1 Cinnamon 5.6
Evolution Mail Client 3.44.4
Brave Browser & Search Engine
User avatar
AndyMH
Level 21
Level 21
Posts: 13578
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to find and modify application icon

Post by AndyMH »

And instead of modifying the /usr/share/icons/hicolor/scalable/apps/lmms.svg file, I'd like to know if I could "override" this behaviour and, for example, add a new icon in ~/.icons and have my system use this one instead? Because I probably will not be able to find the icons that my system uses each and everytime I'd like to modify it.
Just change the .desktop file in usr/share/applications to point at a different icon, i.e. the Icon=lmms line. If you have a launcher on the desktop and it is not a link, don't forget to change that as well - launcher lives in /home/you/Desktop.

Location - I put my icons in /home/you/.local/share/icons, the .desktop file does not need to specify the full pathname for this location. There may be other locations in home where this is also true, but that's what I use. You can also put them wherever you like as long as you specify the full pathname in the .desktop file.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
eatingpanda
Level 1
Level 1
Posts: 47
Joined: Thu Feb 27, 2020 5:32 am

Re: How to find and modify application icon

Post by eatingpanda »

Great feedback, thank you for that!
I also completely forgot about checking ~/.config/plank/dock1/launchers/lmms.dockitem which shows me the following output:

Code: Select all

[PlankDockItemPreferences]
Launcher=file:///usr/share/applications/lmms.desktop
So the part of the Plank icon makes sense now, the icon is just defined in the .desktop file.

However, I don't completely understand yet where my systems looks for the icon if the .desktop file just says Icon=lmms and not a full path?
Is it similar to the PATH variable so you are able to run applications without using their full path?
User avatar
AndyMH
Level 21
Level 21
Posts: 13578
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to find and modify application icon

Post by AndyMH »

eatingpanda wrote: Thu Oct 01, 2020 3:50 pm However, I don't completely understand yet where my systems looks for the icon if the .desktop file just says Icon=lmms and not a full path?
Is it similar to the PATH variable so you are able to run applications without using their full path?
I think so, but I don't fully understand it myself. All I know is the .local folder works and anything you put in /usr/share/icons works. How mint decides to use a 48x48 icon or 24x24 icon or where the equivalent of PATH for icons is I have no idea. Maybe somebody else...
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
eatingpanda
Level 1
Level 1
Posts: 47
Joined: Thu Feb 27, 2020 5:32 am

Re: How to find and modify application icon

Post by eatingpanda »

Ok, no problem! Thank you for helping me out on this!
User avatar
diapason
Level 4
Level 4
Posts: 378
Joined: Mon Apr 09, 2018 5:31 pm
Location: Montevideo, Uruguay

Re: How to find and modify application icon

Post by diapason »

I was intrigued by this so I have been playing around with it in my spare moments and the following might help you track down what you need to do.

Firstly, I made a bootable USB of the XFCE edition to have a look at it. As far as the menu icons go, the first thing I noticed is that in XFCE, right clicking on the menu icon opens a menu which has a properties option which allows you to scale the menu icons in 7 stages, from very small to very large. In Cinnamon, right clicking on the menu button opens a menu with a configure option which allows scaling the menu icons in 7 stages by number of pixels (16,22,24,32.48,96,128) and these are probably direct pixel equivalents of XFCE's very small to very large categories.

If I understand correctly, you want to be able assign precisely defined sizes to your icons so I set about finding where Mint's Cinnamon edition picks up the value for the various icons. In my case it gets it from /home/ian/.cinnamon/configs/menu@cinnamon.org where there is a file O.json which contains all the parameters for menu items and is editable. With regard to icon sizes, it shows the default, maximum, minimum and value. The value figure is the active one and the one you have to change. I have tested it and got the desired result.

Now XFCE obviously doesn't have an O.json file at the location which Cinnamon has. However, I found the article in the link below which suggests you can achieve what you want by modifying the file ~/.config/gtk-3.0/gtk.css He says if gtk.css doesn't exist, create it and "just start putting things in there".

I checked on the XFCE live session and gtk.css does not exist but perhaps it will on an installed system where there has been activity. So, I am wondering if the code which is in the Cinnamon O.json file could be copied into a XFCE gtk.css file and work. That's way beyond my knowledge but, if AndyMH is still watching this post, he might know.I am tempt ed to try it on the live session but I won't have time before the weekend. Here is the link I mentioned above:
https://gottcode.wordpress.com/2017/10/ ... enu-redux/
diapason
Linux Mint 21.1 Cinnamon 5.6
Evolution Mail Client 3.44.4
Brave Browser & Search Engine
User avatar
AndyMH
Level 21
Level 21
Posts: 13578
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to find and modify application icon

Post by AndyMH »

In my case it gets it from /home/ian/.cinnamon/configs/menu@cinnamon.org where there is a file O.json which contains all the parameters for menu items and is editable. With regard to icon sizes, it shows the default, maximum, minimum and value. The value figure is the active one and the one you have to change. I have tested it and got the desired result.
Thanks for that, added to my knowledge, busy on other things but will have a further look. It may also help me with another problem viewtopic.php?f=46&t=331654 - gives me somewhere to start looking.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
eatingpanda
Level 1
Level 1
Posts: 47
Joined: Thu Feb 27, 2020 5:32 am

Re: How to find and modify application icon

Post by eatingpanda »

Thanks again for looking in to it! I wasn't necessarily looking how the system picks the icon size, but more the path it looks for if a launcher has Icon=lmms instead of using a full path.

Anyway, I really appreciate you helping me on this!
tovian
Level 5
Level 5
Posts: 630
Joined: Sun Nov 22, 2015 1:17 pm
Location: Heart of Dixie

Re: How to find and modify application icon

Post by tovian »

AndyMH wrote:Location - I put my icons in /home/you/.local/share/icons
I do not have an "icons" folder in /home/you/.local/share

Will it work as yours does if I simply add it ?

TIA !
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part"
"We're just the guys to do it”

Animal House
User avatar
AndyMH
Level 21
Level 21
Posts: 13578
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to find and modify application icon

Post by AndyMH »

I created /home/you/.local/share/icons, mint by default creates /home/you/.icons (I think, most of my config files date back to LM17). You could use that, your choice. You may need to specify the full pathname to the icon file rather than just the icon filename - try it.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Locked

Return to “Beginner Questions”