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]
154 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,491
- 9
- 28
- 45
19
votes
1 answer
How to validate/verify .desktop files?
I have a couple of .desktop files that aren't working as expected or not at all. I can't see any error anywhere and asking for help on each one seems unproductive. Is there a way I can verify that I'm using the correct syntax in the file, that it…
Braiam
- 35,380
- 25
- 108
- 167
18
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
- 692
- 1
- 5
- 17
14
votes
1 answer
How to pass argument in .desktop file
When launching an application through the command line I successfully use:
gourmet --gourmet-directory $HOME/my/custom/path/
But it does not work when trying to replicate this behaviour on a .desktop file with:
Exec=gourmet --gourmet-directory…
castaway
- 245
- 1
- 3
- 6
13
votes
3 answers
Nix desktop files
When I install a GUI application using nix, I see desktop files end inside ~/.nix-profile directory, e.g:
~/.nix-profile/share/applications/firefox.desktop
However, my desktop expect that files to be in /user/share/applications in order to be able…
cram1010
- 397
- 5
- 13
10
votes
2 answers
i3wm dmenu add .desktop file
I wanted to add Android studio to the i3dmenu in: /usr/share/applications with the file android-studio.desktop containing:
[Desktop Entry]
Version=1.0
Type=Application
Name=android-studio
Exec="/usr/local/android-studio/bin/studio.sh"…
AlKappa
- 151
- 1
- 1
- 5
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,309
- 19
- 69
- 104
7
votes
2 answers
Autostarting .desktop application at startup not working
I have read that adding a .desktop file to /etc/xdg/autostart can start an application at startup. I did the same to execute my application. But nothing happens on startup. Following is the content of my .desktop file:
[Desktop…
Jackzz
- 1,363
- 3
- 15
- 21
7
votes
2 answers
What is Linux equivalent of CMD /K?
There is a .desktop compilation script, that needs to remain open after terminating, in case there are errors I need to correct. In Windows, I would run cmd /k script.bat, and the /k would keep a cmd window open after terminating.
In Linux, my…
Alex
- 1,099
- 2
- 9
- 25
7
votes
4 answers
Getting the current path in .desktop EXEC 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.
my run script is run.sh
I've tried:
[Desktop…
Kiksy
- 253
- 1
- 2
- 9
6
votes
1 answer
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
- 69
- 66
- 195
- 326
6
votes
1 answer
What does %k mean in Exec=?
Exec=sh -c "some command' %k
No info in man sh and man exec on %k.
What does %k mean here?
showkey
- 79
- 23
- 67
- 128
6
votes
1 answer
Spotify controls (next, previous etc) via context menu in gnome favorites
I've added Spotify launcher to Gnome Shell Dash so it's now a favorite app.
How do I add next / prev / play-pause / stop commands to Spotify context menu ?
For those who still find this unclear, the goal here is to have something like this:
Ronan Quillevere
- 281
- 3
- 7
6
votes
2 answers
How do I write a command for the Exec key in a .desktop file containing a reserved character correctly?
I'm trying to make a .desktop file for Minecraft. Nothing appears to happen upon executing the file. I've tried assigning the Exec key as follows:
Exec= java -jar "~/.minecraft/Minecraft.jar"
Exec= java -jar "$HOME/.minecraft/Minecraft.jar"
But I'm…
reggie-man
- 83
- 1
- 5
5
votes
2 answers
Is it possible to tell linux to look for .desktop files in a directory?
I started using rofi as an application launcher using its drun function. It works fine, .desktop files in /usr/share/applications and $HOME/.local/share/applications both show on it with no problems. I've been wanting to change where I keep my…
SandWood Jones
- 53
- 5