Thread: Writing a script to disable/enable the touchpad
hi,
apologise if thread in wrong forum section. ask quick example of how write script toggle touchpad between on , off states. can manually using
however, script see value of "device enabled" , invert it, achieving toggling function. have had programming experience in past, not sure how particular variable in particular device using bash or sh script.code:xinput set-prop "imps/2 alps glidepoint" "device enabled" 0
inputs appreciated![]()
i'm not script kiddie, in fact struggle remember damn syntax, example below demonstrate. @ least bump thread!
ran "man xinput" , found touchpad id "11" , properties can read using "--list-props" option.
string "device enabled" unique, i've tried pick line out find touchpad state (enabled or disabled).
script looks this:-
unfortunately "if" expression (as shown) true, , if put spaces either side of "=" false....code:#!/bin/sh tpadstate=`xinput --list-props 11|grep "device enabled"` echo $tpadstate if [ "$tpadstate"="device enabled (139): 1" ] `xinput --set-prop 11 "device enabled" 0` echo "touchpad disabled!" else `xinput --set-prop 11 "device enabled" 1` echo "touchpad enabled!" fi
...maybe can make of it.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Hardware [SOLVED] Writing a script to disable/enable the touchpad
Ubuntu

Comments
Post a Comment