You are not logged in.

#1 2026-02-03 10:29:50

Pafrapé
Member
Registered: 2010-10-25
Posts: 38

Terminal command to execute a shortcut

Hello, I would like to know if there is a command in the terminal to execute a shortcut, and if so, which one?

Thank you.

Offline

#2 2026-02-03 12:13:19

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,715

Re: Terminal command to execute a shortcut

Terminals typically have their own shortcuts, but if you want to reduce typing shell aliases are an option .

my ~/.bashrc has

alias makepkg='makepkg -Crs --nocheck'

in it .

So everytime I type makepkg as that user the bash shell executes makepkg -Crs --nocheck .
In case I want to execute makepkg without anything added I can type /usr/bin/makepkg .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2026-02-03 12:28:21

Pafrapé
Member
Registered: 2010-10-25
Posts: 38

Re: Terminal command to execute a shortcut

Thank you for your reply.
But that's not what I'm looking for.
I'm trying to find out if it's possible to write a shortcut in the console to run it, and if so, how.

Offline

#4 2026-02-03 12:29:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,510

Re: Terminal command to execute a shortcut

You have to tell us what you mean by 'a shortcut', then. That's not a specific thing in Linux.

Offline

#5 2026-02-03 12:44:08

Pafrapé
Member
Registered: 2010-10-25
Posts: 38

Re: Terminal command to execute a shortcut

For example, the shortcut to launch Dolphin is: Meta+E,
for Krusader: Meta+K,
for Konsole: Ctrl+Alt+T.

I would like to know if it's possible to write these shortcut commands in a terminal to launch the applications, and how to do so.

Thank you for your help.

Offline

#6 2026-02-03 12:56:48

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 460

Re: Terminal command to execute a shortcut

Pafrapé wrote:

if it's possible to write these shortcut commands in a terminal to launch the applications, and how to do so.

What "terminal" do you mean? Pure virtual console or terminal emulator GUI application or terminal multiplexer?
In general terminals are not supposed to bind custom commands execution to hotkeys.

Offline

#7 2026-02-03 13:57:16

Pafrapé
Member
Registered: 2010-10-25
Posts: 38

Re: Terminal command to execute a shortcut

Konsole for exemple

Offline

#8 2026-02-03 13:58:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,510

Re: Terminal command to execute a shortcut

Sure, for example, to run Krusader, you would use 'krusader'.

You use hotkeys to run commands, using commands to run hotkeys makes no sense.

Offline

#9 2026-02-03 15:10:27

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,704

Re: Terminal command to execute a shortcut

Otherwise this would related to the shell, not the TE and you could use bind or bindkey (bash/zsh) but as pointed out: that approach makes little to no sense at all.
wrt the parallel https://bbs.archlinux.org/viewtopic.php?id=311997
https://en.wikipedia.org/wiki/XY_problem - you seem to be trying to brick together a solution for something? In that case it's better to inquire about "something" directly.

Online

#10 2026-02-03 22:03:04

gxt25
Member
Registered: 2017-07-05
Posts: 108

Re: Terminal command to execute a shortcut

Are you looking for something like a bash alias such as k for /usr/bin/konsole ?

I see you've basically said no to this idea earlier but then I'm in the same position as everyone else here, completely missing your goal

Last edited by gxt25 (2026-02-03 22:10:25)


a man a plan a canal panama

Offline

#11 Yesterday 04:24:35

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 220

Re: Terminal command to execute a shortcut

I'm just randomly guessing here but yeah, gnome terminal doesn't allow for adding more shortcuts but does have shortcuts and you can edit the hotkeys.

I would assume it's possible to hax this by editing some config files

Offline

#12 Yesterday 20:56:58

Succulent of your garden
Member
From: Majestic kingdom of pot plants
Registered: 2024-02-29
Posts: 1,270

Re: Terminal command to execute a shortcut

In theory you can bind keys in your window manager or desktop to make a terminal launch a program. For that you can bind in a hotkey a shell script that runs your terminal send to execute from the terminal the execution of something else, like dolphin. But that approach does not have any sense because you can simple do a keybinding for just executing the program that you need. that's what i do. For example:

Super/Windows + b == opening web browser.
Super/Windows + e == opens editor.

And so on and so on. You can also use the letter of the first word of the program in your keybinding. Like Super + c == opening chromium browser.

If you want a keybinding for terminal, like no, I just want to open the programs with keybindings from the terminal and after closing the terminal, the keybindings should not exists longer. Then use aliases. For example is well know in devops that you can use kubectl to operate kubernetes clusters with using the letter k as an alias of kubectl. So that would be in your .bashrc or  whatever you are using: 

alias k='kubectl'

So you can do like the following for example for programs:

alias c ="chromium"
alias g="gimp"

Then close and open the terminal or just make a source .bashrc or source "the file in which you are declaring terminal sesion"

So then you just go for example and do c + enter == opens chromium.  g + enter == opens gimp. after closing the terminal that keybindigns will not be in desktop/wm or any other software. That in theory just two key strokes.


str( @soyg ) == str( @potplant ) btw!

Offline

#13 Yesterday 22:28:52

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 710

Re: Terminal command to execute a shortcut

For any shell that uses readline, such as bash for example, you can bind keys (including ctrl and meta keys etc) to commands in your `~/.inputrc`. Read about "Readline Key Bindings" in the bash man page.

Offline

#14 Today 02:31:35

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 220

Re: Terminal command to execute a shortcut

At least you can bear how excessively rude @succulent is :-)

Offline

Board footer

Powered by FluxBB