Skip to content

Instantly share code, notes, and snippets.

@mengzhuo
Created October 30, 2013 05:38
Show Gist options
  • Save mengzhuo/7227672 to your computer and use it in GitHub Desktop.
Save mengzhuo/7227672 to your computer and use it in GitHub Desktop.
Toggle TouchPad on Linux with synclient, works/Tested on Ubuntu
#!/bin/sh
synclient TouchpadOff=$((`synclient -l | grep TouchpadOff | awk '{print $3}'`==0))
@pushp1997
Copy link

Thanks needed it for a keybinding for a hassle-free typing experience!

@dato
Copy link

dato commented Jan 3, 2023

Could be done using only awk:

exec synclient TouchpadOff=$(synclient | awk '/TouchpadOff/ {print $3 == 0}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment