5

I want to add my own shortcuts to the terminal. So you know like Ctrl+Shift+C copies text, Ctrl+Shift+L clears the terminal.

I would like to be able to execute the command in the current terminal using shortcut. So for example, I press Ctrl+Shift+Q and ls -l executes, etc.

Is that possible?

pomsky
  • 68,507
zupazt3
  • 209

1 Answers1

1

As a workaround I could achieve this by the mix of

  1. Is it possible to achieve autocomplete to predifined text in gnome-terminal?
  2. Custom Keyboard Shortcut
  3. xdotool

Steps

  1. Created a alias for ls -l as ls in ~/.bashrc file:

    screenshot

  2. To type ls and a key press of Enter, used xdotool sleep 1 key l s Return as a command for custom keyboard shortcut:

    screenshot

  3. Result, when I press the shortcut key combo:

    screenshot

Pablo Bianchi
  • 15,657
PRATAP
  • 22,460
  • It's a bit of workaround, but I guess you cannot do any better, so thanks for the answer - it does what I needed. I've just changed xdotool sleep 1 key l s Return to xdotool sleep 0.2 key l s Return, so instead of 1 second it's 0.2 seconds - that way it works quickly. – zupazt3 Mar 29 '19 at 09:58
  • yes it is (sleep value) always user prefered value and based on trails in some cases.. – PRATAP Mar 29 '19 at 10:00