Questions tagged [.desktop]

A .desktop file is a launcher. When run, it executes a command, which usually launches an application. Use this tag if you are asking a question about using a .desktop file or about the .desktop file format in general.

A .desktop file (MIME type: application/x-desktop) is a text file (editable in virtually any text editor like , or , for example) that is used to create program launchers on systems running the X Windowing System. More formally, a .desktop file is a configuration file standardized in the Desktop Entry Specification. It is usually used as an application launcher, which may appear in a menu, on a desktop, or in search results. Application launchers that appear on the Unity left sidebar all appear in one of two possible places: /usr/share/applications or ~/.local/share/applications.

Structure

It has the following basic structure:

[Desktop Entry]
Key1=Value1
Key2=Value2
Key3=Value3
.   .   . (and so on)

Where Key(i) (where i=1,2,3,...,n) and Value(i) can be one of a fixed set described here.

Common keys

  • Categories

    This is an optional field that refers to what type of application the launcher is. Like an educational application (e.g., , , , etc.) would have the category Education. Each category is separated by a semicolon (;).

  • Comment

    This is an optional field that provides a short description of the program the desktop file launches.

  • Exec

    This is what the launcher runs through bash. For example, Exec=scilab would run , if it is installed. This field is mandatory if Type=Application.

  • GenericName

    This is a more generic name (like a group name for the set of applications to which the application belongs) for the application. For example, may have GenericName=Text editor, likewise might have the same GenericName value, that is, Text editor. This key is optional.

  • Icon

    This is the icon given to the launcher. Desktop configuration files by default take their icons from /usr/share/pixmaps/, /usr/share/icons/ and ~/.local/share/icons/, although if you specify the full path of the icon you want you may use icon files outside these directories. These icons can be in a range of different file formats including, but not limited to, .gif, .jpg, .png, .svg and .xpm. This field is optional; if it is omitted an icon like that below will be used in its place.

    Vivacious-Colors application-blank icon

  • Keywords

    This is an optional field that serves as metadata for the desktop entry.

  • MimeType

    This is an optional field that is used to determine which files it will appear in the "Open With" for. For example, if MimeType=text/plain then if this desktop file is saved in the /usr/share/applications or ~/.local/share/applications directories it will appear in the open with menu for all plain text files (e.g., those with the file extension .txt).

  • Name

    This is the name with which the icon is displayed (e.g., if Name=gedit then your launcher will be called gedit). This field can be specified for different languages too, for example, you may have one line Name[en_US]=GNOME Colors that is the Name that appears for the launcher when you are using US English and another line Name[en_AU]=GNOME Colours for if you are using Australian English. This key is mandatory.

  • Terminal

    This field can be either Yes or No and refers to whether or not the program is to be run in the terminal. It is optional and its default value is No.

  • Type

    This is a mandatory field that can only take on three values Application, Link or Directory. It refers to the nature of the launcher, that is, what it does, like whether it serves as a link to a file or folder, or whether it runs an application.

1086 questions
465
votes
16 answers

How can I edit/create new launcher items in Unity by hand?

Will Unity allow making custom launcher icons from .desktop files or via menu editing system? (Right now the launcher doesn't give the option to "keep in launcher" on all programs. For some programs I use, I have to make custom launchers or .desktop…
Ike
  • 5,122
294
votes
22 answers

How can I create launchers on my desktop?

In older versions it was easy to create a launcher on my desktop. All I had to do is right click on my desktop and select the "create launcher" option. How can I create such launchers now?
tinuz
  • 3,962
252
votes
20 answers

Running a .desktop file in the terminal

From what I can gather, .desktop files are shortcuts that allow application's settings to be customized. For instance, I have lots of them in my /usr/share/applications/ folder. If I open that folder in nautilus, I can run these applications just…
Malabarba
  • 10,546
160
votes
10 answers

How can I find *.desktop files?

To the best of my knowledge, all shortcuts in the Unity Launcher have a corresponding *.desktop file. I have one shortcut (for skrooge) that doesn't have an icon. How can I find the *.desktop file corresponding to this shortcut so that I can add an…
KOVIKO
  • 2,163
142
votes
3 answers

What does the StartupWMClass field of a .desktop file represent?

I am working on this pre-existent .desktop file and I have a doubt: The file content is: [Desktop…
AndreaNobili
  • 4,839
111
votes
2 answers

Creating a .desktop file for a new application

I just installed the lastest version of UGENE. I works fine but in order to use it, I have to enter the following in the terminal: cd ugene-1.11.5/ then execute ./ugene -ui to launch UGENE GUI. This takes too long. I would like to build a .desktop…
cooldood3490
  • 1,215
86
votes
6 answers

How do you create a custom application launcher in Gnome Shell?

How do you create a custom application launcher in Gnome Shell? I have a local Eclipse installation that I'd like to be to quickly launch. So I created a symlink to the eclipse binary and placed it on my desktop. If I open a terminal, cd to…
Cerin
  • 6,923
81
votes
5 answers

Adding custom applications to GNOME 3 launcher

Looking for a utility that allows me insert an item into the list of applications that GNOME knows about. For example: I have downloaded Eclipse EE (I have some very special plugins that I need to work with, and those plugins don't "like" the…
Shaftoe2702
  • 913
  • 1
  • 7
  • 7
69
votes
4 answers

Duplicate icons for manually created GNOME launcher items

I have downloaded Aptana Studio 3 and created the following launcher item for using Alacarte: file: alacarte-made.desktop [Desktop Entry] Comment= Terminal=false Name=Aptana Studio…
malhobayyeb
  • 1,522
63
votes
5 answers

Create a .desktop file that opens and execute a command in a terminal

I would like to know how to write the Exec command of a .desktop file to open a new terminal and execute a shell script in it. The shell script is working and accessible by all users. When launching the script from the terminal everything works, but…
61
votes
1 answer

Where are the .desktop icon files stored?

What system folder on Ubuntu 12.10 are the main menu .desktop icons stored at??? I am having trouble locating....
Mike S.
  • 611
60
votes
3 answers

How can I add custom '.desktop' application launchers to Ubuntu Dock?

I have made .desktop files for Ubuntu 16.04 to access my Google Chrome profiles, but once I upgraded to Ubuntu 17.10 (it worked up to Ubuntu 17.04) they got removed from the dock and I can't pin them back. Sample File: #!/usr/bin/env…
Teivel
  • 781
54
votes
6 answers

Are there any GUI apps that can create .desktop files?

My question is simple. Is there any fast and easy way of creating .desktop files for shortcuts? For example, I think you can right click and create .desktop shortcuts in Linux Mint. I already know how to create them from a text editor like…
user257962
45
votes
5 answers
43
votes
6 answers

How can I create a desktop entry for an AppImage?

I want to create desktop entry for Inkscape AppImage. I'm having some issues because I don't have all MIME types or a clear idea about running that kind of app on desktop entry. Does anyone know how I can achieve such a thing?
AtomX
  • 681
  • 1
  • 7
  • 15
1
2 3
72 73