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.

share|improve this question

feedback

1 Answer

up vote 4 down vote accepted

How about

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

Note that there is a third setting, "TouchpadOff = 2", where only tapping is disabled.

Another possibility, a oneliner, but not a very efficient one:

synclient touchpadoff=`{ synclient -l | egrep "TouchpadOff.*= *0" && echo 1 ; } || echo 0`
share|improve this answer
Thx, didn't know about egrep. Btw is it possible to create oneliner? – Miro Oct 10 at 9:07
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.