2

I installed visual studio code from a tar file in /opt/ . So I had to make a desktop file for the application as shown below

[Desktop Entry]
Type=Application
Name=Visual Studio Code
MimeType=text/plain
Actions=New;
Icon=vso.png
Exec="code"
Categories=Utility;TextEditor;Development;IDE;
Terminal=false
#StartupWMClass=code

exec code works perfectly since i have made a symlink. I don't understand where the problem in this file is especially because there is no way to test it and get any errors as far as i could find.

EDIT The file didn't work even when i set an absolute path for exec

  • 1
    Did you make the .desktop file executable? – muru Feb 20 '17 at 12:24
  • yes, even though all the other .desktop files don't have the 'x' flag set. I have set it for all users. – Siddhant Reddy Feb 20 '17 at 12:25
  • 1
    a few things: vso.png is incorrect anyway; either the icon is in the icon searchpath, then don't use the extension, or it is not, then use the full path to your icon+extension. This will break your .desktop file. You have Actions=New;, but no shortcuts? Furthermore, I don't get Exec="code"? When run from either /usr/share/applications or ~/.local/share/applications, it doesn't need to be executable. – Jacob Vlijm Feb 20 '17 at 12:31
  • 1
    Oh, wait, you made a symlink ^. You do realize that a regular .deb installer exists? – Jacob Vlijm Feb 20 '17 at 12:35
  • I tried to make it work by copying parts of sublime text's desktop file. So i commented the Icon key and deleted the Action. – Siddhant Reddy Feb 20 '17 at 12:39

Your Answer

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

Browse other questions tagged or ask your own question.