Desktop Entry Specification

Desktop entry files should have the .desktop extension, except for files of Type Directory which should have the .directory extension. Determining file type on basis of extension makes determining the file type very easy and quick. When no file extension is present, the desktop system should fall back to recognition via “magic detection”.

For applications, the part of the name of the desktop file (before the .desktop) should follow the “reverse DNS” convention, e.g. org.example.FooViewer.desktop.

Desktop entry files are encoded in UTF-8. A file is interpreted as a series of lines that are separated by linefeed characters. Case is significant everywhere in the file.

Compliant implementations MUST not remove any fields from the file, even if they don’t support them. Such fields must be maintained in a list somewhere, and if the file is “rewritten”, they will be included. This ensures that any desktop-specific extensions will be preserved even if another system accesses and changes the file.

Version

Should be 1.0, it refers to the .desktop file version, not to the program version.

Name

The name that should be displayed on the menu.

Exec

The full path to the executable. No need to use ‘.’, it just means the current dir

Path

The dir that will be set as current when the entry is run. You usually don’t need to set it, but I have added it just in case. It is the same as using ‘cd’ in your command line

Icon

The path to the icon file that will be used for the file, it’s likely that the one that you put doesn’t exists, I have changed it for a generic one. You should change this to the file that you want the icon to use

Mimetype

Specifies the kind of files that this program is able to open. I’ve left it empty.

StartupWMClass

Only needed for some programs, It is usually needed by java programs but only set it if you notice some problems.

To use the desktop file from the Dash you will need to copy it to /usr/share/applications for any user to be able to use it (you will need administrator permissions) or to ~/.local/share/applications (where ~ means your user directory) if you just want it to be available for one user.

/home/kimathi/.local/share/applications/jetbrains-studio.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Icon=androidstudio
Exec="/usr/local/android-studio/bin/studio.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-studio

/home/kimathi/.local/share/applications/APK Studio.desktop

[Desktop Entry]
Type=Application
Version=0.9.4
Name=APK Studio
Comment=
# Icon=/home/kimathi/Pictures/apk-studio.png
Icon=apkstudio
Exec=/home/kimathi/apkstudio/d49d3de/apkstudio
Terminal=false
Path=/home/kimathi/apkstudio/d49d3de

icons location:

16, 32, 48, 96, 128, 256

/home/kimathi/.local/share/icons/hicolor/128×128/apps/androidstudio.png

/home/kimathi/.local/share/icons/hicolor/128×128/apps/apkstudio.png

Living in Tune with Nature's Beat (Earth, Water, Fire, Air, Space)

Leave a Reply

Your email address will not be published. Required fields are marked *