0

In Ubuntu 16.04 I have added many custom shortcut keys to launch various applications such as Skype or Firefox.

In the case of Skype I have simply put the word skype in the command box. But when I put any terminal command in that box the shortcut key is ignored. Just for the sake of argument I put echo 'abcd' in the command box and assign Ctrl+Alt+5 to it - nothing happens when I use that shortcut key. I also tried to launch bash script and also python script from the command box of Customs Shortcut Key and again got nothing when I used the assigned shortcut key.

Are there certain restrictions on what can go in the command box of Custom Shortcut Keys? Or am I not using the command box correctly?

  • Maybe the shortcut key for Ctrl+Alt+5 is already exists? Please try a different one – Benny Sep 13 '16 at 17:00
  • that action was to echo 'abcd' in the terminal -- it is a just a test – elmclose Sep 13 '16 at 17:05
-1

You need a console to be able to execute shell commands. If you are using gnome-terminal you can execute a command with -e - so try to assign your command like:

gnome-terminal -e 'top'
  • Your example works. But try the command 'ls -l' and you will see it doesn't work – elmclose Sep 13 '16 at 17:04
  • @elmclose right, but the question is not about reading console output but about executing a scripts. Proposed solution answers your question in current form – madneon Sep 13 '16 at 17:07
  • My main objective is to run a bash or python script. For example how can I run ~/myscripts/test.sh using Custom Shortcut Key? – elmclose Sep 13 '16 at 17:37
  • @elmclose gnome-terminal -e ~/myscript/test.sh;read -n 1. The 'read -n 1' waits for key press. – madneon Sep 13 '16 at 20:23
  • Doesn't work. We shouldn't have to anything more than putting the script file name in the command box -- just as we put the word firefox in the box and it is launched when we use the designated shortcut key. To run a python script I expect to be able to put in the command box ~/my_python_scripts/test.py and for bash script I should be able to put in bash ~/my_bash_scripts/test.sh – elmclose Sep 13 '16 at 21:00

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.