4

I want to make a launcher icon on the dock for VSCode under Ubuntu 20.04. I called it code.desktop and put it in .local/share/applications, then pinned it to the dock. However, when I click on it, I get two icons:

enter image description here

The desktop file looks like this:

[Desktop Entry]
X-SnapInstanceName=code
Name=Visual Studio Code
Comment=Code Editing. Redefined.
NoDisplay=false
GenericName=Text Editor
Exec=/snap/bin/code
Icon=/snap/code/49/meta/gui/com.visualstudio.code.png
Type=Application
StartupNotify=false
StartupWMClass=code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Keywords=vscode;

What gives? I tried the instructions here but they seem to be either obsolete or not applicable to VS Code somehow. wmprop gives me "code", "Code" for the WMClass, and as you can see I've already set that as the StartupWMClass (and the filename of the desktop file, as someone else recommended at that link).

Jack M
  • 1,310
  • 2
  • 16
  • 32

1 Answers1

0

I have no real idea why, but I solved this by renaming my code.desktop to code_code.desktop.

Jack M
  • 1,310
  • 2
  • 16
  • 32