wslg: WSLg doesn't pick up the actual icons of Linux desktop apps
Environment
Windows build number: Microsoft Windows [Version 10.0.22000.348]
Your Distribution version: Ubuntu 20.04
Your WSLg version: 1.0.26
Steps to reproduce
Just run any Linux GUI from the command line or the Windows start menu. All apps have the generic Linux logo icon, which makes them hard to differentiate.
I’ve installed all apps with apt install
.
Expected behavior
I expect each app to display it’s all icon (as defined by appname.desktop
).
Actual behavior
The same generic icon is displayed in the taskbar as well. Interestingly, when I run Emacs as root
it displays the right icon.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 13
- Comments: 17 (3 by maintainers)
I am having the same issue and could not resolve it reading the above. For example, I installed Gitkraken:
Then I launch it:
I see the generic icon.
Here are the logs:
Any idea how to fix this?
Should I add a
/usr/share/applications/GitKraken.desktop
icon? What format should the icon be?ANSWER: Nevermind, I was able to find the solution. There was a
gitkraken.desktop
file, so I renamed it to match the AppIdGitKraken.desktop
and it works.That being said, is there a way to change the generic linux icon displayed on top of the icon based on the distro? When using the same softwares in different distros, it’s impossible to know which one is which as they all look the same.
This is because current WSLg doesn’t support SVG icons. Though this function code has been added but the corresponding SVG lib can’t be found in Mariner (A Microsfoft linux distro) repository. Refer to this to has more details.
Thank you very much @andnig, following the cache refresh tip from that MS answer I finally got the icons to work for the task bar as well.
EDIT: For reasons I can’t comprehend, the taskbar shows the correct window just as of today. 3 windows restarts (not weston, the full OS) were in between but nothing else was changed. So my below comment is not valid anymore. Quick recap what I did and what works now:
/usr/share/icons/hicolor/$size/apps/
(with size being 128x128, 16x16, 256x256, 32x32, 512x512, 64x64)EDIT2: Ok there seems to be an icon cache in windows, didn’t know that. So, after following the steps above, make sure to refresh the icon cache. Follow the second answer (user Omoikane1122) in this MS answer
------------ original comment -----------------
I have a similar issue, but none of the workarounds helped so far. All the icons are correctly set in the start menu, however not in the task bar.
Task bar:
WSL version: 2.0.14.0 WSLg version: 1.0.59
For eg. for kitty, my desktop file is at
/usr/share/applications/kitty.desktop
, Icon is set to ‘kitty’ and there is an appropriately sized ‘kitty.png’ file in folders/usr/share/icons/hicolor/$size/apps/
(with size being 128x128, 16x16, 256x256, 32x32, 512x512, 64x64)Is there a chance to get the icons also working on the task bar? Where do we need to put the icons so that they are used in the taskbar?
Another use case is when using an AppImage. In that case, there is no entry in
/usr/share/applications/
so it’s not a mismatch of AppId. Any workaround to this?Thanks
It looks like weston doesn’t look for icons in
/usr/local/share/icons/
As a workaround for emacs I edited file/usr/local/share/applications/emacs.desktop
and changed Icon toemacs29
and copied icon files from emacs checkout to/usr/share/icons
Restarted wslg and emacs now has emacs icon in windows.