9

Due to the generic code name, the Numix team have decide not to use the code.desktop icon provided by the VS Code package.

So it's icon is configured as a common text editor by default.

How to fix it?

15

Here's a one liner that will achieve what these guys are saying for you. I've aliased this in bash because I have to execute this every FREAKING time vscode updates...

sudo sed -i "s/Icon=code/Icon=vscode/g" /usr/share/applications/code.desktop
|improve this answer|||||
10

Looks like that the Numix team has provided an alternative icon with the name of vscode.desktop, in order to fix it we need to:

  1. Copy and rename the default code.desktop to the local user directory:

cp /usr/share/applications/code.desktop ~/.local/share/applications/vscode.desktop

  1. Edit the new vscode.desktop and rename all Icon properties from Icon=code to Icon=vscode.

The result should be something like this:

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

X-Desktop-File-Install-Version=0.22

[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
Exec=/usr/share/code/code --new-window %U
Icon=vscode
  1. Restart the session to apply the new icon.
|improve this answer|||||
  • 1
    The answer from @gvsrepins work for me. But I did the Icon name change in the /usr/share/applications/code.desktop with root permission right there instead of duplicating it in the ~/.local/share/applications/ directory. This prevents it from showing duplicate icon in the application list. – Lalnuntluanga Chhakchhuak Sep 27 '17 at 11:37
  • If this doesn't work, try editing /usr/share/applications/code.desktop directly instead. – nilanjanaLodh Oct 12 '17 at 21:06
  • Note: you can use sudo desktop-file-install vscode.desktop to update the icon without logging in and back out. – nico Aug 7 '18 at 6:38
0

If you're absolutely sure Visual Studio Code will be the only 'code' executable,

just copying the vscode.svg icon seems to be a better solution

as it'll also theme the icon if you launch vscode via terminal command: code.

sudo ln -s visualstudiocode.svg /usr/share/icons/Numix-Circle/48/apps/code.svg
sudo dpkg-reconfigure numix-icon-theme numix-icon-theme-circle
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.