I'm using lubuntu. I want to add a shortcut to toggle (turn on and off) my touchpad.
I know I need to edit the xml file in ~/.config/openbox (in my case it's lubuntu-rc.xml) as described here and here
I want it to trigger it when Fn and F5 are pressed (on my dell there is a touchpad icon on it, so I assume it triggers also a x86 keybind, dunno if that matters)
on my machine
synclient TouchPadOff=1
turns off the touchpad, and
synclient TouchPadOff=0
turns it on again.
The command
synclient
without any options, returns this list
Parameter settings:
LeftEdge = 300
RightEdge = 1700
TopEdge = 210
BottomEdge = 1190
FingerLow = 12
FingerHigh = 15
MaxTapTime = 180
MaxTapMove = 107
MaxDoubleTapTime = 180
SingleTapTimeout = 180
ClickTime = 100
EmulateMidButtonTime = 75
EmulateTwoFingerMinZ = 141
EmulateTwoFingerMinW = 7
VertScrollDelta = 48
HorizScrollDelta = 48
VertEdgeScroll = 1
HorizEdgeScroll = 0
CornerCoasting = 0
VertTwoFingerScroll = 1
HorizTwoFingerScroll = 0
MinSpeed = 1
MaxSpeed = 1.75
AccelFactor = 0.0819336
TouchpadOff = 0
LockedDrags = 0
LockedDragTimeout = 5000
RTCornerButton = 2
RBCornerButton = 3
LTCornerButton = 0
LBCornerButton = 0
TapButton1 = 1
TapButton2 = 3
TapButton3 = 0
ClickFinger1 = 1
ClickFinger2 = 1
ClickFinger3 = 0
CircularScrolling = 0
CircScrollDelta = 0.1
CircScrollTrigger = 0
CircularPad = 0
PalmDetect = 0
PalmMinWidth = 10
PalmMinZ = 100
CoastingSpeed = 20
CoastingFriction = 50
PressureMotionMinZ = 15
PressureMotionMaxZ = 80
PressureMotionMinFactor = 1
PressureMotionMaxFactor = 1
ResolutionDetect = 1
GrabEventDevice = 1
TapAndDragGesture = 1
AreaLeftEdge = 0
AreaRightEdge = 0
AreaTopEdge = 0
AreaBottomEdge = 0
HorizHysteresis = 12
VertHysteresis = 12
ClickPad = 0
as you can see, there is the line "TouchpadOff = 0".
So what I'm basically asking for is someone who knows how to work grep and regular expressions to tell me how to write a shell script that reads the output of snyclient and executes "synclient TochPadOff=0" or "synclient TochPadOff=1" accordingly.
If found this script that does something very similar , but I'm struggeling on the grep part.
If found a generic toggle script , but I think grepping the info is cleaner.
I also already know how to bind a shellscript to a keyboardshortcut from that example.
help greatly appreciated .