5

I use synclient touchpadoff=1 to disable touchpad and synclient touchpadoff=0 to enable touchpad.

$synclient | grep TouchpadOff
    TouchpadOff             = 1

I'd like to create script that will toggle this value. Then I will bind to key in OpenBox.

1 Answer 1

8

How about:

if synclient -l | egrep "TouchpadOff.*= *0" ; then 
    synclient TouchpadOff=1 ; 
else 
    synclient TouchpadOff=0 ; 
fi

For reference a third setting, TouchpadOff = 2, disables only tapping.


Or a one-liner:

synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*0')

References:

1
  • Thx, didn't know about egrep. Btw is it possible to create oneliner?
    – kravemir
    Oct 10, 2012 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .