Bug 438985 - keyboard shortcuts dont work with sh scripts
Summary: keyboard shortcuts dont work with sh scripts
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keys (other bugs)
Version First Reported In: 5.21.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-21 09:29 UTC by Bronson
Modified: 2021-08-22 10:35 UTC (History)
3 users (show)

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


Attachments
1 (683.02 KB, image/png)
2021-06-23 09:20 UTC, Bronson
Details
2 (619.45 KB, image/png)
2021-06-23 09:21 UTC, Bronson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bronson 2021-06-21 09:29:19 UTC
SUMMARY
keyboard shortcuts dont work with sh scripts

STEPS TO REPRODUCE
1. create a sh script that creates a file 'touch test.txt'
2. create a shortcut pointing the the test.sh
3. active hotkey, no file is created, script has not run

OBSERVED RESULT
nothing happens

EXPECTED RESULT
sh script should execute the same as if it was clicked in dolphin or from the terminal

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.21.5
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2021-06-21 11:39:32 UTC
Please include a screenshot of how you are creating a shortcut pointing to the file.

Please ensure the script works if you do ./myScript in a terminal and not "sh myScript" (i.e executable + correct shebang line)
Comment 2 Bronson 2021-06-23 09:20:43 UTC
Created attachment 139605 [details]
1
Comment 3 Bronson 2021-06-23 09:21:00 UTC
Created attachment 139606 [details]
2
Comment 4 Bronson 2021-06-23 09:22:15 UTC
Attached screenshot of 2 different methods tested for executing script.

sh files works from console fine, and from dolphin with clicking:

#!/bin/bash
touch hi.txt
Comment 5 Bug Janitor Service 2021-07-08 04:33:49 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Nate Graham 2021-07-30 18:16:15 UTC
Works for me with KHotkeys, but I cannot even get the script file to appeal in the (non-Custom) Shortcuts KCM at all. Can you please confirm that the script file has been marked as executable?
Comment 7 Bronson 2021-08-01 06:11:45 UTC
yep the script is executable. When I execute it manually it works fine. Just my hot key is not working.
Are you adding it via 'Shortcuts' or 'Custom shortcuts' ?
Comment 8 Nate Graham 2021-08-02 16:42:09 UTC
I added it via Custom shortcuts and it worked.

I was unable to add it via Shortcuts due to Bug 440431. Were you able to somehow work around that?
Comment 9 Bronson 2021-08-05 08:09:27 UTC
Yes I was previously able to add it shortcuts as an application before the plasma 5.22 update. But I can no longer add it on 5.22.

Adding to custom shortcuts is not triggering still. What I have noticed it that none of the custom shortcuts work for me! Print screen for example does not work. 

I think this may be from my custom kde script where I configure the shortcuts. This is my kde configuration script (for manjaro) which removes a lot of fluff I don't use. I suggest you run this in a manjaro vm on a fresh install. That should reproduce the issue.

https://github.com/bit-shift-io/scripts/blob/master/kde.sh

I'm still hanging out for a way to import/export all kde settings instead of this script :)
Comment 10 Nate Graham 2021-08-06 18:04:09 UTC
OK, so we have a couple of bugs then. Bug 440431 is about being unable to add script shortcuts at all in the Shortcuts KCM. This is about them not working if you manage to add them (though the root cause might be the same).

If no global shortcuts are working at all for you, that would be still another bug. This is working for me, FWIW.
Comment 11 Bronson 2021-08-06 23:21:36 UTC
Looking at this again, its not all of the shortcuts not working. My shortcut to open the terminal for example works (ctrl alt t) and dolphin (meta e). So i'm still not sure whats going on.
Comment 12 Bronson 2021-08-22 10:35:50 UTC
Well this is now working for me!
I dont know whats changed, but suddenly working!