13
votes
How do I debug a .desktop file?
You can also use the validation tool desktop-file-validate to find more problems.
(see also: How to validate/verify .desktop files?)
# Result for your example
$ desktop-file-validate qutebrowser....
9
votes
gtk-launch only works when present working directory is Desktop
To make this work, you have to satisfy two requirements:
Your myapp.desktop file should reside in one of several directories (not exclusively /usr/share/application). These depend on your Linux ...
9
votes
How do I debug a .desktop file?
I normally add the following to see what is being executed:
Terminal=true
TerminalOptions=\s--noclose
8
votes
Accepted
set multiple environment variables in .desktop file
As mentioned above, your variant with the addition of several variables should work correctly
Exec=env FOO=bar /usr/bin/my_prog
So either there is some kind of external factor, or the question is ...
8
votes
"@@" in Flatpak desktop files
--file-forwarding
If this option is specified, the remaining arguments are scanned, and all arguments that are enclosed between a pair of '@@' arguments are interpreted as file paths, exported in the ...
7
votes
Accepted
Steam is unable to create .desktop file(s). Workaround or fix?
TL;DR
Create the .desktop file with contents, the Steam Id of Project Hospital is 868360, you can see this number inside the Steam link, e.g.:
https://store.steampowered.com/app/868360/...
7
votes
How to launch `.desktop` files from the terminal (or dmenu)
As this Ask Ubuntu SE answer and GitLab issue comment state:
#!/usr/bin/env sh
gio launch '/path/file.desktop'
6
votes
What does %k mean in Exec=?
According to the Desktop Entry Specifications:
%k The location of the desktop file as either a URI (if for example gotten from the vfolder system) or a local filename or empty if no location is ...
6
votes
List all desktop files that appears in application menu
Instead of searching the filesystem yourself, you could use the Gio library (part of Gtk/GObject/GLib ecosystem on which Gnome is built). You can use this through Python on any Gtk-based desktop ...
6
votes
Accepted
Why are environment variables not resolved when double-clicking .desktop file?
From the Ubuntu documentation 1:
Shell config files such as ~/.bashrc, ~/.bash_profile, and
~/.bash_login are often suggested for setting environment variables.
While this may work on Bash shells for ...
5
votes
Autostarting .desktop application at startup not working
My standard debugging flow for desktop entry file (.desktop application):
file format - check if the desktop entry follow the spec of freedesktop.
executable command - if the previous check looks ...
4
votes
Do `%f, %F, %u, %U` belong to bash?
Have a look at Recognized Desktop Entry Keys of FreeDesktop.
Specifically have a look at the Exec Key.
In your case $U means it should handle the input which comes after the call to the program as ...
4
votes
Accepted
Where is the relevant .desktop file?
You should be able to find the file in one of these folders:
/usr/share/applications
/usr/local/share/applications
~/.local/share/applications
See https://wiki.archlinux.org/index.php/...
4
votes
How to associate markdown files with a web browser?
Based on this:
pandoc README.md | firefox "data:text/html;base64,$(base64 -w 0 <&0)"
# or
python3 -m markdown README.md | firefox "data:text/html;base64,$(base64 -w 0 <&0)&...
4
votes
Accepted
Making Neovim from GitHub the default file handler for text/source files
Have you tried setting and exporting one or more of the $VISUAL, $EDITOR, $SENSIBLE_EDITOR, or $SELECTED_EDITOR environment variables? This would need to be done in the environment before running ...
3
votes
i3wm dmenu add .desktop file
dmenu can find applications in /usr/bin or /bin/
So you can just create a symbolic link to the path of studio.sh, which would be
sudo ln -s /usr/local/android-studio/bin/studio.sh /usr/bin/android-...
3
votes
List all desktop files that appears in application menu
The free desktop specification for the Applications menu search path is here. The short answer to your question is append "applications" to every directory in the search path $XDG_DATA_DIRS.
3
votes
Why is the icon I've placed into /usr/share/icons not displaying in the MATE Applications menu?
I had the same problem and what worked for me was to update the cache of the hicolor theme: /usr/share/icons/hicolor/icon-theme.cache. You do this with the following command:
sudo gtk-update-icon-...
3
votes
Accepted
How to define wm class for terminal commands in .desktop files
You can't setup WM_CLASS via .desktop file because it is up to application to set up its own WM_CLASS.
But many applications still allow to change their class using standard methods of their toolkit (...
3
votes
Accepted
Trying to get process name from Exec= line in .desktop file. Error when running Exec= when its a bash script
It looks like your exe variable has the name of the script quoted. So, if the script is foo.sh, then $exe is actually "foo.sh" and not foo.sh. Therefore, you are telling bash to find a file ...
3
votes
Accepted
Autostarted .desktop application doesn't exit on log out
This is because KillUserProcesses is no by default in Ubuntu. This setting causes user processes not to be killed when the user completely logs out. To change this behavior in order to have all user ...
3
votes
How to launch `.desktop` files from the terminal (or dmenu)
Provided that they are executable (chmod u+x /path/to/app.desktop) you can add this shebang at the top:
#!/usr/bin/env xdg-open
And from then on you can call your application with:
/path/to/app....
3
votes
Accepted
Is it possible to tell linux to look for .desktop files in a directory?
If you want another one directory for desktop files, you need to create a directory with the name applications somewhere. For example:
$HOME/desktop/applications
Then put the path of the parent folder ...
3
votes
Accepted
Application showing in Menu, but .desktop file not present in /usr/share/applications
The .desktop file of Flatpak apps are generally stored at:
/var/lib/flatpak/app/[app name]/current/active/export/share/applications.
The .desktop files for per-user applications are stored at:
~/....
3
votes
Is `xdg-open`, `gtk-launch`, or `gio-launch` preferable for invoking `.desktop` files via the CLI?
I would recommend xdg-open; this is a shell script that will try and work out the current desktop environment and use the appropriate command, which may include testing multiple alternatives (eg gio ...
2
votes
Getting the current path in .desktop EXEC command
As mentioned in Desktop Entry Specification, %k or other field codes must not be used inside a quoted argument. However, there are ways to copy an expression with space to a variable without using ...
2
votes
How do I debug a .desktop file?
I've been debugging a desktop file and found this useful article on the archlinux website.
https://wiki.archlinux.org/title/desktop_entries#Run_a_desktop_file_from_a_terminal
If gtk3 is installed, ...
2
votes
gtk-launch only works when present working directory is Desktop
The manpage states the following:
gtk-launch takes at least one argument, the name of the application to
launch. The name should match application desktop file name, as
residing in /usr/share/...
2
votes
Start desktop launcher from command line on Mint
The dex application is probably the simplest way to do this.
sudo apt install dex and then dex ~/Desktop/some-application.desktop or since many/most system applications are in /usr you could use dex /...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
.desktop × 175linux × 15
gnome × 15
ubuntu × 11
terminal × 11
kde × 11
bash × 10
shell-script × 10
freedesktop × 9
xfce × 8
linux-mint × 7
gnome-shell × 7
xdg × 7
xdg-open × 7
command-line × 6
desktop × 6
application × 6
menu × 6
launcher × 6
debian × 5
gnome3 × 5
wine × 5
autostart × 5
arch-linux × 4
quoting × 4