Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate VS Code icon in dock when vs code is launched using .desktop file generated via toolbox-export #4

Open
manan-gup opened this issue Sep 12, 2022 · 1 comment

Comments

@manan-gup
Copy link

manan-gup commented Sep 12, 2022

Hi,

When I launch VS Code via the .desktop file created by toolbox-export it creates a duplicate icon and does not recognize StartupWMClass in the file pasted below. If I run xprop WM_CLASS and click on the VS Code window I get WM_CLASS(STRING) = "code", "Code".

Any suggestions to troubleshoot this will be appreciated.

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=toolbox run -c fedora-toolbox-35 /usr/share/code/code --unity-launch %F
Icon=com.visualstudio.code
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=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

Running Fedora Silverblue 36 with GNOME v42.4 on wayland.

@galpar
Copy link

galpar commented Jan 22, 2023

If you are running under Wayland, you have to use the following StartupWMClass=code-url-handler, instead of Code or code. This script doesn't copy the code-url-handler.desktop file to ".local/share/applications/", so you have to copy it manually and add the toolbox run to Exec=. Also, I suggest adding "--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations" launch options to enable proper Wayland support for VSCode. Reboot.
With these steps, I do not have a duplicate icon anymore. Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants