This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to add a new shortcut from terminal?

Tags: shortcut, command, terminal, bash, shell, keyboard shortcut, command, terminal, bash, shell, keyboard shortcut, command, terminal, bash, shell, keyboard
(comma "," separated)
User avatar
KZKG^Gaara
Registered Member
Posts
2
Karma
0
OS
Hi,
I'm doing a small application, to complete I need to know how to add a new keyboard shortcut, but from a terminal.
In other words... a command to set that [alt]+[shift]+[r] is going to run ~/.record.sh; for example.

I would appreciate any help, any clue.
Thank you very much.

Best regards.

PS: I apologize for my English, is not my primary language.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
Do you want it to work even if you aren't in a terminal (i.e., a global shortcut that will launch a terminal running ~/.record.sh)? In that case there are many ways, here's one:
System Settings -> Shortcuts and Gestures -> (Custom Shortcuts ->) Edit -> New -> Global Shortcut -> Command/URL.

Give the shortcut a name.
Trigger tab: Set the shortcut you want to use.
Action tab: Enter e.g.
Code: Select all
konsole --noclose -e ~/.record.sh

Click on Apply to save your settings.

Hope that's what you wanted!


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar
KZKG^Gaara
Registered Member
Posts
2
Karma
0
OS
Thanks for your answer Hans.
I need to create global shortcut yes, but from terminal.
Add a global shortcut through a command, for example:

:~$ addgshortcut [ctrl]+[shift]+[r] ~/.record.sh

And then, when I press [ctrl]+[shift]+[r] the sistem go to execute: bash ~/.record.sh

Thank you very much for your attention.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]