A .desktop file describes how a particular program is to be launched, how it appears in menus, etc. It is used by Freedesktop-compliant environments such as Gnome, KDE and Xfce.
Questions tagged [.desktop]
161 questions
33
votes
1 answer
What is the TryExec field in .desktop files?
I have searched a great deal and have been unable to find an answer to this. What does the TryExec field do in .desktop files? How does it differ from the Exec field?

Rohan
- 3,561
20
votes
5 answers
How do I debug a .desktop file?
I have a .desktop file to start a python program in a specific conda environment, like this:
[Desktop Entry]
Version=1.0
Name=Qutebrowser
GenericName=Web Browser
Comment=View and edit files
MimeType=text/html;
Exec=bash -c "source…

Anaphory
- 712
7
votes
2 answers
set multiple environment variables in .desktop file
I can add env in .desktop file in /usr/share/applications/
Exec=env FOO=bar /usr/bin/my_prog
but I need to set 2 environment variables and no approach that I tried works (using env twice, appending second assignment after ;)
How can I set 2 env…

Martin Vegter
- 358
- 75
- 236
- 411
7
votes
1 answer
Should "#!/usr/bin/env xdg-open" be included in .desktop files?
Some people add the following line to a .desktop file:
#!/usr/bin/env xdg-open
But when I checked files under the /usr/share/applications/ in my debian sid, there's no such file that would include this line.
So the question is simple: should it be…

Mikhail Morfikov
- 10,549
4
votes
4 answers
How to launch `.desktop` files from the terminal (or dmenu)
I want to run .desktop files from the terminal and dmenu. From the terminal, it should ideally be run with ./app.desktop or /path/to/app.desktop, and app.desktop would be put in a $PATH directory. I'd rather not have to use an external command like…
2
votes
1 answer
.desktop file execute error message
I want to run a program with a specific user group and added sg mygroup before the command in the Exec line of a .desktop file. While I could successfully run the command in a terminal, I could not start it by clicking the menu icon (nothing…

Knut
- 201
1
vote
3 answers
How to automatically “Run in Terminal” for script in CentOS linux
I have a simple script that basically does "tail -1000f /public/XERlog"
I created a file called log.desktop on the desktop which contains:
Exec= tail -1000f /public/XERlog
Name=…

clayton33
- 111
1
vote
1 answer
Mailto not working with custom .desktop file
My problem is that mailto links do not seem to work properly. I'm using Sylpheed, but that's not specific to the problem. I created a file at /usr/share/applications/sylpheed-compose.desktop so that mailto links open the proper window within…
user36373
1
vote
1 answer
Getting Current path in .desktop entry for ICON command
Im trying to make a .desktop file run a .sh which is stored in the same directory as the .desktop. The whole directory needs to be portable and moved from machine to machine.
Now I can get the current path for EXEC command using the method from :…

Harsh Trivedi
- 111
1
vote
0 answers
How to put a desktop entry into applications list in open-with dialogs?
Here is my desktop file:
[Desktop Entry]
Exec=/home/kaiyin/workspace/python/python3_scripts/unz.py…

qed
- 2,669
0
votes
0 answers
Make a .desktop file that runs a command line
Okay so maybe I'm being stupid, but I can't figure out what I'm doing wrong, so I'm asking here for help.
I made a .desktop file in /usr/share/applications to create a shortcut for a specific command I usually ran in the terminal. However, no matter…

archuser
- 11
0
votes
1 answer
.desktop is not showing via right click
I created .desktop app and it is stored (/usr/share/applications), (.local/share/applications), but I am unable to open via GUI like..right click on mp4 and open with other application. This .desktop app is not showing on open with other…

Vipul Meher
- 1
- 2
0
votes
0 answers
How to change user in .desktop file?
I have a .desktop file whose Exec= line I want to be run as another user. In a systemd service file, I can achieve this with a User= and Group= option. How to do the same in a .desktop file?

ARX
- 457
-1
votes
1 answer
How to make a Chromium instance with its own icon
As you probably have noticed most calendaring applications in Linux suck, so I have decided doing something about it.
Basically I want to create an Arch package that puts Google Calendar right into the applications menu. That launches Google…