How to Create a .Desktop File for Your Application in Linux

A .desktop file is simply a sooner way that is given to takeoff implementations in Linux. Without the .desktop file, your task won’t arrive in the Entreaties menu and also can’t be launched wearing third-revelry launchers such as Ulauncher and also Albert.
The majority of implementations, once installed, will most undoubtedly invent the .desktop records unwittingly and also void themselves in the “Accomplishment” menu for quickly itineraries. Yet, if you compile a educational program from source or download an app in archive format, this can not be the capsule, and also you can have to responsive the terminal to perform the binary every time you stab to application it. Apparently, this can come to be a incorrectly lazy and also bugging relocation. This tutorial mirrors how you can invent a .desktop file for any task you application that can be launched from the “Accomplishment” menu.
- How to Invent Desktop Launchers
- How to Xerox .Desktop Documents
- How to Invent .Desktop Documents Through a 3rd-Celebration Curriculum
- Commonly Enquired Frustrations
Also read: Top 6 Linux Desktop Districts of 2024
How to Invent Desktop Launchers
A .desktop file is a rudimentary message file that holds honesty around a educational program. It is traditionally brandished in “~/.area/share/implementations” or “/usr/share/implementations/,” counting on whether you stab the launcher to be readily accessible for your area account onlly or for everyone. If you navigate to either directory in your Record Employer, you will most undoubtedly investigate rather a few .desktop records that coincide wearing the installed apps on your computer.
For objection purposes, we are composing a .desktop file for Super Tux Kart, a kart racing video game we like to dabble sporadically. A disparity is conveniently available in the Ubuntu repos, but this is sporadically behind the latest stable disparity.
The simply way to avail the latest and also highest liberate is by downloading and also install a tar archive, removing it and also executing a file which will most undoubtedly takeoff the video game.
Also read: How to Amass rid of a Catalog in Linux
You can adhere to along wearing whichever educational program you stab to invent a launcher for, and also it need to job-related unchanged way.
Note: the obeying vacancies assume you have the archive for the educational program you stab to invent a launcher for in your “Downloads” folder.
- Peruse to the directory whereby the archive is saved, appropriate-click it and also pick “Remove here.”

- As speedily as the removal is substantial, readjust to the recently invented folder and also position the executable.
- Proper-click it and also pick “Run as a Curriculum” to takeoff the educational program simply to guarantee it is massaging.

- In some skins, you won’t investigate the “Run” selection in the menu, sporadically because the executable is a .message file. You can avail around this by executing it wearing the terminal.

- If you’ve attested that the task works once you takeoff it, you can departure it.
- Departure your message editor and also paste the obeying into the bare message file:
[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Exec=/path/to/executable Name=Name of Application Icon=/path/to/icon
Note: You’ll should readjust the “Exec” arena to the course to the executable and also “Moniker” arena to the name of the task. The majority of powers supply an icon someplace in the archive, so wear’t neglect to involve that too. In our capsule, the launcher file for Super Tux Kart appearances like the obeying pic.

- Save the file in the “~/.area/share/implementations” folder as “task-name.desktop”. The “.area” folder is a undisclosed folder in your “Abode” directory and also “Divulge Undetected Documents” mode will most undoubtedly have to be permitted for you to sight it. If you stab it to be worldwide readily accessible, rushed the obeying command in the terminal:
sudo mv ~/.local/share/applications/<application-name.desktop> /usr/share/applications/
Note: wear’t neglect to readjust
- As speedily as performed, responsive the “Entreaties” menu on your desktop to position the .desktop app.

The strategy staked out here need to job-related on with one voice mainstream Linux-based operating mechanisms. Proper here’s another screenshot reflecting Super Tux Kart in Xubuntu’s task launcher (XFCE).

Also read: How to Recover the “Clearly no Installment Prospect” Perplexity in Ubuntu
How to Xerox .Desktop Documents
As identified overhead, you can attain a .desktop file from a educational program that you have installed wearing a repository. This is priceless if you stab to invent a customised .desktop file as a way of combatting a exceeded package in Ubuntu.
For the the majority of component, each Linux ration is vastly unchanged in its texture, so while this sector will most undoubtedly greatly focus on Ubuntu 22.04, you can still application these instructions in your favorite desktop finalizing.
- To prelude, responsive a Record Employer from your desktop. In this capsule, we are opening Nautilus, as it is the default for Ubuntu.
- Press the “Other Locales” entry in Nautilus’s escaped side nightclub.

- This carries upward a list of with one voice the tool locales in your machine. Press “Computer.”

- Amass forced in “/usr/share/implementations.” This directory includes the .desktop records that your desktop manager intakes to invent its Accomplishment Sustenance selection.

- Xerox the task you stab to invent a sooner way to. For instance, appropriate-click on “firefox-esr.desktop” and also pick “Xerox.”

- Go ago to your desktop and also void the .desktop file by appropriate-clicking and also pick “Paste.”

- Proper-click on your .desktop file and also pick “Permit Launching.” Performing this will most undoubtedly package the authorization detritus so that your desktop finalizing can application this file to takeoff your educational program.

Also read: How to Sight WebP Pics on Linux
How to Invent .Desktop Documents Through a 3rd-Celebration Curriculum
Aside from editing and also copying .desktop records, it is in a identical way you can conceivably reckon of to invent sooner ways in Linux wearing a Graphical Individual Interface (GUI) educational program. This is easy to understand if you are not comfy wearing editing configuration records.
Polymorphous the previous ideologies, this will most undoubtedly require you to location a educational program like Arronax, which can not be current in your ration’s repository. In spite of that, it is still you can conceivably reckon of to application it by procuring a xerox from the creator’s website. To location the GUI in Ubuntu, adhere to the below instructions.
- Contain a third-revelry repository by running the obeying command:
sudo add-apt-repository ppa:diesche/stable

- Iinstall the GUI educational program by running the obeying command:
sudo apt install arronax
- On the innumerable other hand, if you are mounting it wearing a tarball, you should unpack the archive making gain gain service of of of tar:
tar xvzf /home/$USER/Downloads/arronax-0.8.1.tar.gz

- Run Arronax by either running the command below or keying “arronax” while in the Accomplishment Sustenance selection. This will most undoubtedly lug upward a window whereby you can invent and also preserve .desktop records.
./setup.py && ./run.py

- To invent your initially sooner way making gain gain service of of of Arronax, click the “Brand-favored” icon in Arronax’s Sustenance selection Pub to invent a decor that you can application for your sooner way.
- Deliver the sooner way’s name and also a file course to your educational program. For example, we are composing a .desktop file for Firefox by keying “Firefox” in the “Title” arena and also
/bin/firefox-esr
in the “Command” arena.

- Press the environment-friendly arrowhead in Arronax’s Sustenance selection Pub to preserve the sooner way.

- In this example, we’re conserving it as “Firefox.desktop” in our desktop directory.

- Proper-click this .desktop file and also pick “Permit Launching” to package the authorization detritus for it, as affirmed overhead.
Also read: How to Kit Upwards Bluetooth in Linux
Commonly Enquired Frustrations
Is it you can conceivably reckon of to application a .desktop file even if I am making gain gain service of of of a window manager?
Clearly no, a .desktop file will most undoubtedly not job-related on the majority of window supervisors, as it does not have the compulsory strengthen for the “XDG Sustenance selection” parameter. While it is you can conceivably reckon of to invent a .desktop file in a window manager, it will most undoubtedly not arrive as a desktop sooner way. One way to recreate this mechanism is by making gain gain service of of of skin scripts along with the Humble X Hotkey Daemon.
Is it you can conceivably reckon of to invent a .desktop file for CLI and also TUI implementations making gain gain service of of of Arronax?
Of course! You can readily invent a .desktop file for a educational program that runs in the terminal, which is easy to understand if you are currently making gain gain service of of of TUI powers and also stab to have a quickly way to itineraries them.
To perform this making gain gain service of of of Arronax, invent a favored .desktop sooner way by offering both a “Title” and also a “Command,” then toggle the “Run in Incurable” selection and also preserve the favored sooner way.
Is it you can conceivably reckon of to conceal a desktop sooner way from an Accomplishment Sustenance selection?
Of course! It is you can conceivably reckon of to tailor a .desktop file to not verify on your Entreaties Sustenance selection by adding a standoffish queue of code in the file that you stab to modify. For example, if you stab to conceal Firefox from your Entreaties Sustenance selection, responsive the “firefox-esr.desktop” file in “/usr/share/implementations”. From there, add Hidden=true
at the run out of the file, then restart your computer to use the variations.
Pic credit rating: Charles-Adrien Fournier wearing Unsplash Unanimously screenshots by Ramces Red.