1

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.

Aqua-
  • 57

2 Answers2

3

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.

Joris
  • 61
  • 1
    First thank you for the answer. I followed the instructions here and on the other post you linked, still my terminal doesn't recognize the file from anywhere (i have to be inside the specific folder to activate it from the terminal). – Aqua- Apr 17 '18 at 03:52
  • NP. Can you see the file when you browse to /home/yourname/bin with the Nautilus file manager? – Joris Apr 17 '18 at 15:09
  • yes i can. infect the code is working well when i execute it from terminal. i just cant seem to bind it to a key – Aqua- Apr 17 '18 at 17:03
1

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.

Aqua-
  • 57