Bug 388350 - Custom shortcuts and krunner do not work with scripts without shebang
Summary: Custom shortcuts and krunner do not work with scripts without shebang
Status: RESOLVED UNMAINTAINED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_khotkeys (other bugs)
Version First Reported In: 5.20.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Jansen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-30 10:59 UTC by Alexander
Modified: 2024-03-04 19:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander 2017-12-30 10:59:19 UTC
Since upgrading to KDE frameworks 5.41 (from 5.38 I think?) custom shortcuts don't work when the "Action" points to a shell script.

To test:
I created a new custom shortcut, assigned Meta-Z to it, and wrote "/usr/local/bin/test_shortcut" as its Action.

/usr/local/bin/test_shortcut contains:
---------------------
#!/bin/bash
/usr/bin/kwrite
---------------------

Pressing Meta-Z (Win-Z) doesn't do anything except maybe flickering the active window titlebar.
Running the shell script directly runs kwrite.
Putting "/usr/bin/kwrite" into the Action field works, it runs kwrite.

Thanks
Comment 1 Alexander 2017-12-30 11:21:55 UTC
Upon further investigation, I have to correct the report.

Basically, the shortcuts fail only if the shell script doesn't have "#!/bin/bash" in the beginning. This used to work in older versions.
They also fail with krunner.
Comment 2 Martin Flöser 2017-12-30 11:54:05 UTC
Reassigning to khotkeys as this provides the "custom shortcuts".
Comment 3 Christoph Feck 2018-01-10 15:14:50 UTC
I doubt that 'khotkeys' looks at the contents of the assigned scripts. I have no idea where to reassign to, though.
Comment 4 Nate Graham 2024-03-04 19:41:54 UTC
As announced in https://pointieststick.com/2023/07/26/what-we-plan-to-remove-in-plasma-6/ and https://community.kde.org/Plasma/Plasma_6#Removals, I'm afraid KHotKeys has reached end-of-life in Plasma 6. Accordingly, all bug reports and feature requests for it must be closed now.

Most of what KHotKeys could do can already be done with the newer KGlobalAccel system in Plasma 6. A few features such as mouse gestures and triggering conditions based on changes to window states are not yet implemented in the new system. These will be added in the future if and when resources materialize for them, and/or when a kind soul submits patches to implement them! :) Meanwhile, the 3rd-party "Mouse Actions" app (https://github.com/jersou/mouse-actions) may be usable for implementing your own mouse gestures again.

Thanks for your understanding, everyone.