Adding a program link

I’m running F40 with Gnome on xOrg because my tablet no longer works properly under KDE/Plasma…

Under KDE I have a desktop icon/shortcut to a 3rd party program that opens the program. The same .desktop file doesn’t work under Gnome. Instead of opening the program it opens a text file showing the “contents”(?) of the file.

I don’t need the icon on the desktop but I’m getting tired of drilling through the file system to find the executable. Is there some way of creating a shortcut to the executable under Gnome?

KDE and Gnome share the same Desktop Entry Specification, but some details have evolved over time, and implementations may have different bugs.

You haven’t provided enough detail to understand why yours isn’t working. Try running
desktop-file-validate <your desktop file>, the use desktop-file-install:

$ dnf info desktop-file-utils
[...]
Installed packages
Name            : desktop-file-utils
Epoch           : 0
Version         : 0.27
Release         : 2.fc41
Architecture    : x86_64
Installed size  : 230.4 KiB
Source          : desktop-file-utils-0.27-2.fc41.src.rpm
From repository : fedora
Summary         : Utilities for manipulating .desktop files
URL             : https://www.freedesktop.org/software/desktop-file-utils
License         : GPL-2.0-or-later
Description     : .desktop files are used to describe an application for inclusion in
                : GNOME or KDE menus.  This package contains desktop-file-validate which
                : checks whether a .desktop file complies with the specification at
                : http://www.freedesktop.org/standards/, and desktop-file-install
                : which installs a desktop file to the standard directory, optionally
                : fixing it up in the process.
Vendor          : Fedora Project
1 Like

I toss things behind bash -c usually and that’s worked fine on Linux across GNOME, Plasma, and Xfce even on FreeBSD.

Here’s what I do for Diablo II (full notes):

[Desktop Entry]
Name=Diablo II: Lord of Destruction
Categories=Game;AdventureGame;RolePlaying
Exec='/bin/bash' -c "cd ~/'.wine/Diablo II/drive_c/Program Files/Diablo II' && WINEPREFIX=~/'.wine/Diablo II' wine 'Diablo II.exe' -3dfx"
Type=Application
StartupNotify=true
Icon=0913_Diablo II.0
StartupWMClass=game.exe

That might be different if using something other than Bash or sh.

The desktop file is located in /home/username/Desktop - from what I’m reading it may be in the wrong location?

Running desktop-file-validate threw a couple of warning messages. (lines with duplicated values)

this is the current desktop file:

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/home/username/Stitchmastery/Stitchmastery
GenericName[en_US]=
GenericName=
Icon=/home/username/Stitchmastery/icon.xpm
MimeType=
Name[en_US]=StitchMastery
Name=StitchMastery
Path=/home/username/Documents/Knitting/StitchMastery
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

The program is written in Eclipse and uses Python.

I copied the current desktop file to /home/.local/share/applications and it now works Thanks

The correct location for .desktop files is a directory named applications under one of the top-level directories in $XDG_DATA_FILES. Note that Fedora’s $XDG_DATA_FILES may include directories that arnt present on your system and is inconsistent about the trailing / in directory names. If $HOME/.local/share is not already present in $XDG_DATA_DIRS, I would add it for use with “personal” applications and create a $HOME/.local/share/applications directory.

Thanks.

I’ll look for the directories