custom shortcut key ignores commands

Bug #1623382 reported by Davood Heshmaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-control-center (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu 16.04 LTS. I have tried to run this python script from github:

https://gist.github.com/SergKolo/ff9defd9cef4e704a64be505f28fa3cd

by defining a custom shortcut key and placing the command:
 python ~/my_pythons_scripts/append_clipboard.py

in the command box. Nothing happens when I use the designated shortcut key.

The same happens when I try to run a bash script by custom shortcut keys

Both the python script and my own bash script run from terminal successfully.

In fact none of the shell commands placed inside the command box of custom shortcut keys is executed

Oddly enough there is no problem launching installed programs, such as skype or firefox.

In other word if your command is, say, firefox then you are ok. But not when you want to run your own scripts.

Initially I assumed I was not binding the keys properly and posted this question in Askubuntu:
https://askubuntu.com/questions/824439/commands-and-the-custom-shortcut-keys

unsurprisingly I have had no solutions offered.

Tags: keys shortcut
tags: added: keys shortcut
Revision history for this message
Davood Heshmaty (elmclose) wrote :

I have now found out that the shell commands placed in the command box of Custom Shortcut Key must be inside single quote marks AND preceded by bash -c

this rule also applies to running scripts, e.g.

bash -c 'python ~/my_pythons_scripts/append_clipboard.py'
bash -c 'bash ~/my_scripts_folder/script1.sh'

None of this is explained in any documentations. It should at least be added as examples of how to assign custom shortcut keys to run commands and scripts

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.