Problem with .desktop file on Debian12 with Gnome 43.9

I’m trying to set up desktop shortcuts for some applications i’m using on a daily basis, however i can’t make sense of how it is actually working.
Because i want to be able to add, remove and modify shortcut easily i rather have those file in a .desktop directory that i’m keeping in my user directory (home/baptiste). To my understanding it should work just fine.

I’m using Debian 12 with Gnome 43.9 and editing the .desktop file with a text editor.

One of the shortcut is working exactly as expected it’s a Windows .exe running through wine, the .desktop file is located in my target directory at home/baptiste/.desktop

[Desktop Entry]
Type=Application
Name=Linkuit Studio
GenericName=Linkuit
Comment=Wine32
Exec=wine /home/baptiste/.wine/drive_c/Program Files\ \(x86\)/Linkuit\ Studio/Linkuit\ Studio.exe
Terminal=false
StartupNotify=false

I’ve check and it appears that this guy is only located here (no copy in /usr/share/applications nor home/baptiste/.local/share/applications).

However i have two other .desktop that are not working at all as they do not appears in the app menu.

The first one links to a shell script (bash) located in another directory (home/baptiste/src/RANDOM/), the script activate a python venv and execute a python App.
here is the .desktop file :

[Desktop Entry]
Type=Application
Terminal=false
Name=Random
Icon=/home/baptiste/src/RANDOM/icon.png
Exec=bash /home/baptiste/src/RANDOM/Random.sh

and the .sh script which doesn’t seems to be the issue as when invoked with bash home/baptiste/src/RANDOM/Random.sh it launches the app (no matter where i’m located) :

#!bin\bash
cd ~/src/RANDOM/
. ./bin/activate
python3 App.py

This one drives me crazy as previously the .desktop file was located in the ~/src/RANDOM/ directory. The shortcut was appearing in my App menu (without the icon, but who cares) and worked just fine.

The last one needs to launch an AppImage also located in my home/baptiste/src/ directory :

[Desktop Entry]
Type=Application
Terminal=false
Exec=home/baptiste/src/Nextcloud-3.11.0-x86_64.AppImage
Name=Nextcloud
Icon=/home/baptiste/src/Nextcloud.png

I’ve made some experiments with the .desktop entries like commenting/uncommenting the Icon entry (doesn’t matter), checking if the command line in the Exec entry launch the app (it does), trying with Terminal = true to see if i would have an error (no error)…

Therefore i have several questions :

  • How and why the first one is working perfectly and not the other ? Am I missing something very obvious ?
  • What are the requirements for a desktop entry to be added to the App Menu in Gnome ? Does the shortcut need to link to a valid command line or is it only checked when clicked (this one is more personal curiosity).
  • While experimenting with .desktop files, how to refresh the App Menu without logging out or rebooting ?
  • What’s the “101 - How to .desktop file” procedure ? Is there any program out there to create .desktop file through GUI or CLI ?

On other topic i’m fairly new to GNU/Linux and Computer Sciences in general, i’ll be very open to best practices/suggestions.

Relevant documentation i’ve found :
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

The problem is not permission related as ls -l yields:

-rwxr-xr-x  1 baptiste baptiste  220 28 déc.  17:14 'Linkuit Studio.desktop'
-rwxr-xr-x  1 baptiste baptiste  156 28 déc.  17:09  Nextcloud.desktop
-rwxr-xr-x  1 baptiste baptiste  145 28 déc.  17:07  Random.desktop

home/baptiste/src/Nextcloud.png is a relative path. Absolute paths start with a /.

1 Like

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.