Score:0

Why are some desktop icons not displaying correctly?

um flag

I have xubuntu 20.04. Some of the programs I install don't show correctly. For example, Visual Studio Code, and Firefox dev. While other programs do display their icons correctly. Is there any way to fix this?

Image: enter image description here

Content of .desktop of Visual Studio Code:

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code --unity-launch %F
Icon=com.visualstudio.code
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/share/code/code --new-window %F
Icon=com.visualstudio.code
us flag
Did you create those desktop files? You need to edit them in a text editor, and apply appropriate icons. Can you edit the question and post the contents of those .desktop files?
Luis avatar
um flag
Firefox dev was extracted from a .tar.bz2 file. So inside the extracted folder there is no .desktop file, there is only an executable file that cannot be opened with a text editor.
David avatar
cn flag
The Firefox shown in the picture is not a desktop entry it is an app icon. You could try and make a desktop entry for it.
Score:1
pk flag

Some desktop icons are not appearing because the way how the icons can't be found. From your example you specifically included:

Icon=com.visualstudio.code

The FreeDesktop specification mentions that the value, i.e. com.visualstudio.code, should be either an absolute path or an "icon identifier" which are meant to be filled by the appropriate icon from icon themes.

In this case I see that you're using the Elementary icon theme, which of course, doesn't include a dedicated icon for Visual Studio Code, or specifically com.visualstudio.code(.png) from /usr/share/icons/elementary/.

The solution

Sure, there's always a workaround for this, especially for the case of Firefox Dev, which requires you to get a square-sized PNG or XPM icon (recommended to be 128x128, 192x192, or 256x256), then include them into your current icon theme by running

xdg-icon-resource install --size 128 com.visualstudio.code.png

To apply changes, simply log out and log in again. Or else, you can also force XFCE to update their icon cache by running gtk-update-icon-cache -f ~/.local/share/icons.

References:

Score:0
aw flag

Just had to deal with this on fresh install of Xubuntu 20.04.5 LTS running XFCE 4.14 and Visual Studio Code 1.74.2, showing the generic gear icon instead of the VS Code icon.

I used Shift and Shiftine's suggestions to poke around and try to locate the icon. I was able to see it when using the GUI to browse, but it wouldn't let me save it/set is as the icon despite numerous attempts.

I had to search for the png file and found it at:

/usr/share/pixmaps/com.visualstudio.code.png

and updated the entry in the code.desktop file like so:

Icon=/usr/share/pixmaps/com.visualstudio.code.png

You can also just right-click the icon, click Edit Launcher, and choose an image file from the dropdown. Navigate to the icon at:

/usr/share/pixmaps/com.visualstudio.code.png

Then click save.

Once I edited that, saved it and closed the icon popped right up like it should. But each time I went to launch it, it would complain that it was trying to execute but wasn't yet set to be executable, and should I launch it anyway. I fixed that by chmod'ing the file based on some reading I was doing here on the VS Code Github, which has supposedly since been resolved:

chmod +x code.desktop

Now the icon looks correct and it launches without error!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.