Ubuntu: binding keyboard shortcut


Im trying to bind a script i wrote (copied) as a keyboard shortcut. I wrote a script in bash that would enabled/disable my touchpad and called it touchpadt.sh.

when i run the script on the terminal directly it works good: Terminal shot

however i try to bind a keyboard shortcut through the keyboard options in system settings and i cant seem to insert the right data for the binding. there are 2 fields to fill - Name & Command: binding command

what should i write in the "command" box, and where should i store the code? also how can i restrict the usage of this command only to registered users? - so that guests for example will not be able to use it (i used -x permission, but i dont really know what it means)

Thanks in advance.


See this answer on how to create a custom command:

mkdir ~/bin  mv touchpadt.sh ~/bin  chmod +x ~/bin/touchpadt.sh  

You should now be able to run 'touchpadt.sh' anywhere in the terminal. Test it and if it works you can enter it in the keyboard shortcut settings.


I finally found here The command needed to be written is as follow: sh /full path/script.sh. for the full path it is best to enter the terminal, go to the directory containing the code (using ls and cd commands) and then write pwd for the full path.

Thank you for your help.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »