#!/bin/bash # enable/disable trackpoint mouse wheel emulation xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5 case $1 in on) xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1 exit 0 ;; off) xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 0 exit 0 ;; *) ACTIVE=$(xinput list-props "TPPS/2 IBM TrackPoint" | awk '/Evdev Wheel Emulation \(/ {print $5}') if [ "$ACTIVE" == "0" ]; then xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1 else xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 0 fi exit 0 ;; esac