Questions tagged [.desktop]

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.

Filter by
Sorted by
Tagged with
14
votes
1answer
5k views

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?
10
votes
2answers
3k views

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=...
9
votes
1answer
4k views

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 ...
7
votes
1answer
5k views

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 ....
6
votes
1answer
919 views

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 ...
6
votes
1answer
913 views

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 ...
6
votes
1answer
755 views

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?
6
votes
3answers
6k views

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 ...
6
votes
2answers
5k views

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/...
5
votes
0answers
88 views

library for .desktop files [closed]

How can I read .desktop files without having to (re)invent the wheel?  Is there a Python or C library that is available in the Ubuntu repos?  Or something with a command line front-end that could be ...
4
votes
1answer
617 views

Steam is unable to create .desktop file(s). Workaround or fix?

Today, I bought Project Hospital game on Steam for my Linux Mint 19 Cinnamon. I do have only this game installed, so I am unable to determine if the issue persists with other games. While the game ...
4
votes
1answer
576 views

How could a script know the path of the .desktop file that launched it?

How would a bash script know if it has been launched by a .desktop file, and how would it know the path of that launcher? Extra Points: How would I extract the "comment" field of that .desktop file - ...
4
votes
2answers
334 views

Bash command to delete a certain file in * folders

I have a .desktop file that execs with bash -c to set an environment variable then load the program. Now I need to add another command before it goes to loading the program. Sometimes the program ...
4
votes
1answer
187 views

determine (in script) if command runs in terminal (from desktop file?)

Simplified down, I want to write a shell function which runs a program in a new window. For applications like … emacs, firefox, gitk that can look like this: myopen() { $@ } But I want to open ...
3
votes
2answers
1k views

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 ...
3
votes
1answer
277 views

Read .desktop files programmatically [closed]

I would like to make a C program (GTK) that reads a .desktop file. The only thing I need from the .desktop file is the exec command. Is there something built into GTK that would allow me to interact ...
3
votes
2answers
2k views

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 ...
3
votes
1answer
1k views

List all desktop files that appears in application menu

Context I'm using GNOME 3.22 and I want to organize all desktop files in groups. To do so, I must list all desktop files that appears in the application menu and use some command from this guide to ...
3
votes
1answer
2k views

.desktop file does not work from /usr/share/applications

I created the following .desktop file under Fedora 24 using GNOME 3. [Desktop Entry] Encoding=UTF-8 Name=Jabref Exec=java -jar /home/zoltan/Bureau/Programs/JabRef-3.7-dev--snapshot--2016-11-08--...
3
votes
1answer
4k views

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 ...
3
votes
2answers
1k views

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= ...
2
votes
1answer
376 views

What is the advantage of .desktop files without executable bit set?

The freedesktop organization defines the standard for .desktop files. Unfortunately it defines not the permissions of the file (see freedesktop mailinglist) and software is distributed with a) ...
2
votes
1answer
715 views

Xampp launcher does not open window

I am creating Xampp desktop launcher on my Linux Mint 19 and I have very interesting problem. When I run this from terminal: pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /opt/lampp/manager-...
2
votes
1answer
6k views

How do I create an Xfce application menu containing only the contents of one category?

I want to create an application menu in Xfce that contains no submenus, rather just contains application launchers for all .desktop files in the virtualization category. If you are uncertain as to ...
2
votes
1answer
2k views

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 ...
2
votes
1answer
668 views

Add another sub-level to KDE-Submenu in Dolphin actions/services?

Is it possible to create lower levels of sub-menus in Dolphin context menu than the one created by the line X-KDE-Submenu= under [Desktop Entry]? Example: I have created an action called "Subtitles"...
2
votes
1answer
510 views

.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 ...
2
votes
1answer
398 views

.desktop file. Correct exec path

I use Fedora. There are a number of programmes packaged in a security spin. Included desktop files work but open the programmes with root priviliges. How can I edit the desktop file shown here to ...
2
votes
2answers
245 views

Duplicates of .desktop files in Linux

I have a duplication of NetBeans for .desktop . I cannot find where these .desktop files are, I have searched for them using the GUI file explorer and cannot find them. And yes, I have looked in /usr/...
2
votes
0answers
55 views

Locate the .desktop file for a special menu item

There are various reasons why orphaned menu items can remain after package removal and need to be fixed in the package. In order to investigate the bug, it can help to see the exact path of the ....
2
votes
1answer
27 views

How to give a program an additional name/label for search?

I am starting a lot of programs via the synapse launcher. For convenience, I'd like to give a program an additional name/label/tag/whatever, such as "XXYYZZ". Is this possible (on XFCE)?
2
votes
0answers
47 views

Formatting of strings in .desktop files

I have accidentally noticed that on my machine (running KDE) fields of desktop entries (those little .desktop files used to make desktop icons and such) may contain some simple HTML-style formatting, ...
2
votes
0answers
178 views

how to specify which terminal is used by gtk-launch

As discussed here, gtk-launch can launch applications either directly or in a terminal window, depending on whether the .desktop file specifies that the application runs in a terminal. It seems to me ...
2
votes
1answer
154 views

.desktop file for ncurses application

I am trying to create a .desktop file for the calcurse ncurses calendar application: [Desktop Entry] Version=1.0 Type=Application Name=calcurse Comment=an ncurses calendar TryExec=calcurse Exec=...
2
votes
1answer
589 views

Making vim the default editor when I double click a file

When I run vim from the start menu, it opens up an xfce terminal window and runs vim. However, when I set vim to be my default text editor and double-click a file, it runs in xterm instead of the xfce ...
2
votes
0answers
239 views

How to make desktop shortcut to start command with custom title font and window borders

Im Using Linux Mint 17.2 rafaela amd64 with cinnamon. I have a couple old windows themes I downloaded and if I apply them with the system settings dialog I get this: t Which is great! Except I only ...
2
votes
0answers
110 views

Keep mouse pointer busy while launching a script

I have a Windows program which is run via wine. Since it needs a couple steps of preparation, I created a script app.sh: #!/bin/sh do-something do-something-else wine app.exe Then I added the app to ...
2
votes
2answers
2k views

How to add a software to the list under “open with” other applications in Linux Mint 16?

I want to add a software to the "open with" other applications list that drops down after clicking on a photo to open. I installed Photoscape on my Linux Mint 16 system but it does not show in the ...
2
votes
1answer
449 views

Proper use of escape characters in desktop file

I have a command with a working .desktop Exec key as follows: Exec=env XDG_CONFIG_HOME=/home/bean/.config/gedit/ gedit %U I would like to use the $HOME variable instead and it works in the terminal ...
2
votes
2answers
138 views

Nightly show as Firefox in Dash

I have created the following .desktop file in ~/.local/share/applications, when I search "Nightly" Nightly appears in search results with the correct icon(earth at night), but when I opened it it ...
1
vote
3answers
3k views

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= XERlog Path=/tmp/ ...
1
vote
1answer
1k views

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 ...
1
vote
1answer
128 views

How do I make custom .desktop files behave correctly in the Gnome 3 sidebar?

I've installed TeamSpeak 3 to $HOME/Applications and I've created a custom desktop file: [Desktop Entry] Name=TeamSpeak 3 Comment=VOIP Client Path=/home/tomas/Applications/TeamSpeak3-Client-...
1
vote
3answers
2k views

Start desktop launcher from command line on Mint

Can I start a desktop launcher from command line? E.g. I have a desktop launcher for slack in my ~/Desktop directory: vadim@my-pc ~/Desktop $ cat slack.desktop [Desktop Entry] Name=Slack Comment=...
1
vote
1answer
146 views

How to check why .desktop file is not running?

I have a desktop file with the following content: [Desktop Entry] Type = Service Name = Konqueror Exec = konqueror %U Comment = KDE File Manager & Web Browser Icon = konqueror Upon launching it ...
1
vote
1answer
1k views

How to fix the intermittent double click behavior of my Ubuntu 16.04 Unity desktop files

I tried and tested @terdon's .desktop file yesterday. Here it is: "A cleaner way would be to write a .desktop file that launches your script and then double click that. Something like: [Desktop ...
1
vote
1answer
125 views

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 ...
1
vote
1answer
2k views

Run specific command from .desktop with root

I have a program that I wish all users of my linux install to be able to run with root privileges from a .desktop file. Currently in my .desktop file I have: Exec=gksu command but this of cause ...
1
vote
0answers
61 views

How debug the launch of a .desktop Desktop's file

When I right click a desktop icon, and click 'Execute' after a certain amount of seconds I get: "Did not receive a reply. Possible causes include: the remote application did not send a reply, the ...
1
vote
1answer
37 views

Desktop environment that raises terminal with gnu-screen instead of starting new one

I want to start a gnu-screen session, in a terminal, from gnome. I wrote the following desktop file [Desktop Entry] Version=1.0 Name=Screen Comment=Use the command line Keywords=shell;prompt;command;...