Skip to main content

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
code:
xinput set-prop "imps/2 alps glidepoint" "device enabled" 0
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.

inputs appreciated

quote posted almikul view post
...your 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:-
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
unfortunately "if" expression (as shown) true, , if put spaces either side of "=" false....
...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

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account