[SOLVED]Where are the Icons for Desktop Shortcuts stored?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED]Where are the Icons for Desktop Shortcuts stored?

Postby banjo » May 22nd, '18, 19:38

I installed the program "mc" and created a desktop shortcut to it. I could not find the icon for the program, so I created a placeholder icon and called it "mc.svg" and put it into the folder /usr/share/icons/hicolor/scalable/apps/. After I did that, the icon showed up in the dialog box invoked from the Properties dialog of the .desktop file. After selecting it, it showed up in the desktop shortcut. So far so good. It wasn't the correct icon, but it showed up.

Here is where it gets nutty.

I went to another system and found the real mc.svg file, so I replaced the the mc.svg placeholder that I created with the real one. But the old one still showed up in the shortcut. The only mc image that I can find in the system is my mc.svg file, which no longer contains that old image. I have created a new .desktop shortcut to see if the problem persisted after starting from scratch, but when I select mc.svg in the dialog box, it still shows the old icon. As far as I can tell, I have completely removed the old mc.svg file from the system, so I am confused about where Plasma is getting the old image.

The desktop file identifies the image only as "Icon=mc".

Code: Select all
Desktop Entry]
Comment[en_US]=
Comment=
Exec=konsole -e mc
GenericName[en_US]=
GenericName=
Icon=mc
MimeType=
Name[en_US]=MC IconTest
Name=MC IconTest
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=


Plasma must have squirreled away the original image somewhere and is using that image instead of the original. It must still have the old image, or it could not be showing it.

To test this, I copied mc.svg into mc-real.svg and then selected the mc-real icon for the shortcut, and the new icon appears. But then, if I go back to mc.svg, the old icon is back. According to kdiff3, he two files mc.svg and mc-real.svg are identical. The old image is not there.

mc-compare.png
Kdiff3 comparison of mc.svg and mc-real.svg
mc-compare.png (142.52 KiB) Viewed 826 times


So, does anyone know where Plasma is keeping a copy of that old icon? I would like to reset it, but I cannot find it.

BTW, this is not something that I need to fix, but I am curious about how this software works.

Thanks,
Banjo
(_)=='=~
Last edited by banjo on May 23rd, '18, 03:42, edited 1 time in total.
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 445
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: Where are the Icons for Desktop Shortcuts stored?

Postby banjo » May 23rd, '18, 03:41

OK. Nevermind. I found it.

The icons appear to be stored in ~/.cache/icon-cache.kcache

I moved that file into ~/.cache/icon-cache.kcache.cya, then I logged out and logged back in, and the new icon was in the shortcut. The icon-cache.kcache file was restored with the new data when I logged back in.

From what I have read, it appears that the icon-cache is used to avoid tons of disk reads to get that information. So in order to change the image after changing an icon image file, just delete the cache and it will be restored with the new image in it.

Banjo
(_)=='=~
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 445
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: [SOLVED]Where are the Icons for Desktop Shortcuts stored

Postby doktor5000 » May 23rd, '18, 18:38

The actual icons (not the cache) are stored in quite a few places. See the Icon key in https://standards.freedesktop.org/deskt ... 01s06.html which links to https://specifications.freedesktop.org/ ... atest.html
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED]Where are the Icons for Desktop Shortcuts stored

Postby banjo » May 23rd, '18, 18:50

doktor5000,

Thank you for the links to the documentation. I will go study it.

Banjo
(_)=='=~
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 445
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron