Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer 1

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 '12 at 9:07

Your Answer

 
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.