0

I want to configure a locally installed unpackaged application to be started via applications menu in Debian. It should be independent of desktop environment and visible to all users. I don't want to install any Gnome or KDE dependencies to perform this simple task.

Which command is more suited to install desktop files in my case?

Possible candidates:

  • xdg-desktop-icon
  • desktop-file-install

What is the the difference between these?

1

xdg-desktop-icon adds an icon to the current user's desktop, it doesn't add entries to all users' menus.

desktop-file-install installs .desktop files to the user's applications directory when run as a non-root user, and to /usr/share/applications if run as root (thanks for pointing that out), so you can use that to install an application entry in the menu.

You could also install an application in the menu for all users manually; all that's needed it to create a .desktop file and copy it to /usr/share/applications.

For non-packaged applications you can also use /usr/local/share/applications (creating it if necessary); that works at least in Debian 8. So with desktop-file-install you'd run (as root)

desktop-file-install --dir=/usr/local/share/applications ...

See "Howto desktop files" and the relevant specification for more details.

  • Wrong for privileged context. At least desktop-file-install targeted /usr/share/applications when ran under root. I see a problem here - this folder is for packaged desktop files. – Basilevs Apr 17 '15 at 2:11
  • First link recommend desktop-file-install, but I believe packaged application is implied – Basilevs Apr 17 '15 at 2:22
  • Thanks, I've fixed my answer. Regarding packaged applications being implied, you're right in that /usr outside /usr/local is supposed to be managed entirely by packages, so /usr/share/applications shouldn't be used for non-packaged application entries. – Stephen Kitt Apr 17 '15 at 4:51

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.