https://bugs.kde.org/show_bug.cgi?id=441197

            Bug ID: 441197
           Summary: Custom Shortcuts Don't Exec .Desktop files that exec
                    sh
           Product: frameworks-kglobalaccel
           Version: 5.85.0
          Platform: Archlinux Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdelibs-b...@kde.org
          Reporter: lu...@lwsabota.com
  Target Milestone: ---

SUMMARY
When a custom shortcut is configured to use a user desktop entry that utilizes
"sh" in the desktop file's Exec line, the shortcut does not spawn the program.

Desktop files can use /bin/sh to resolve common variables, such as $HOME, that
can be very useful to execute applications that are stored within a user's home
directory.  Here is an example of a desktop file for qrdp, a custom qt
application that is located in a user's home directory:

---
qrdp.desktop
---
[Desktop Entry]
Version=1.0
Name=QRdp
Comment=Connect to an RDP server
Keywords=Internet
Exec=sh -c "~/.bin/qrdp"
Icon=Qrdp
Terminal=false
X-MultipleArgs=false
Type=Application
Categories=Network;

This file can be placed in ~/.local/share/applications and it properly parsed
by the plasma start menu and krunner, as well as gtk-launch and dex.  It can be
validated with desktop-file-validate.

However, if this desktop file is used in a custom shortcut, the program will
not launch when the shortcut is pressed.

Changing the exec line from 'Exec=sh -c "~/.bin/qrdp"' to a hardcoded home
directory will allow the desktop file to be launched from a kglobalaccel
shortcut:

Exec=/home/mySpecificUser/.bin/qrdp

STEPS TO REPRODUCE
1. Install a desktop file that utilizes /bin/sh in the Exec= line to
~/.local/share/applications
2. Add a shortcut for this desktop file in plasma shortcuts
3. Attempt to use the shortcut, notice the application does not launch

OBSERVED RESULT
The application contained in the desktop file does not launch when launched via
a kglobalaccel shortcut

EXPECTED RESULT
The application contained in the desktop file is launched when configured as a
kglobalaccel shortcut and the shortcut key is pressed

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.13.10-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 15.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to