Bug 430768

Summary: Shortcut in KMenuEdit does not work with scripts in /usr/bin
Product: [Applications] kmenuedit Reporter: YAFU <yafulinux>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.20.4   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description YAFU 2020-12-23 23:45:31 UTC
SUMMARY
Keyboard shortcuts created from KMenuEdit for scripts in /usr/bin do not work.

STEPS TO REPRODUCE
1.Create a Script in /usr/bin, for example
$ kate /usr/bin/screenpowersave.sh

With content:
#!/bin/bash

sleep 5; xset dpms force standby

2. Open KMenu edit, create a new entry to launch the script, In General tab, select the script in Command field: /usr/bin/screenpowersave.sh
3. In Advanced tab create a new keyboard shortcut to launch the script, and save the changes

OBSERVED RESULT
When you press the keyboard shortcut to run the script, it is not executed

EXPECTED RESULT
Run the script

SOFTWARE/OS VERSIONS
KDE Neon 20.04 (Testing)

KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0

ADDITIONAL INFORMATION
The method I describe above had always worked for me. It stopped working about a year ago when many bugs related to custom keyboard shortcuts had also been reported. Run the script from the Applications Menu or run "/usr/bin/screenpowersave.sh" from Krunner, the script is executed correctly. Only trying to run with the configured shortcut en KMenuEdit doesn't work.
Comment 1 YAFU 2020-12-23 23:56:20 UTC
In the description in Step 1 I forgot the step that you have to give the script permission to execute, of course.
$ sudo chmod +x screenpowersave.sh
Comment 2 YAFU 2020-12-24 02:01:10 UTC
Ok, this is driving me crazy. I have tried recreating the steps for a whole new script, with a whole new entry in KMenuEdit and a whole new shortcut and it worked. But then removing that new entry and trying to configure old KMenuEdit entry with that new script never worked again.
I have not been able to determine when it works and when it does not.