4

How can I set a global shortcut in KDE (4.4) to run a bash script?

7

First make sure that your script is executable, e.g. like this

chmod +x ~/scripts/myscript.sh

Then create the shortcut using the tool which can be accessed by System Settings > Input Actions. Do a right click in the left pane where existing shortcuts are listed and say New Global Shortcut > Command/URL. Set the name to something sensible, choose your desired shortcut, set the command to your script, e.g. ~/scripts/myscript.sh and tick the Enabled box. If you put your script in a folder in path, (following common conventions one would use /usr/local/bin) you can skip the path in the command and just write myscript.sh.

  • 1
    I can not find input actions (using debian jessie, kde 4.14.2) – ctrl-alt-delor Sep 6 '15 at 20:53
  • 2
    In Wheezy and Jessie it seems to be: System Settings →shortcuts and gestures →Custom shortcuts » edit →new →global shortcuts → command/url (maybe for all other systems using newer KDE). Why they hid it?, We may never know. (I just realised that I have just answered my own comment.) – ctrl-alt-delor Sep 7 '15 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.