diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-10-08 10:52:59 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-10-08 10:54:24 +0200 |
commit | de5439b63b9fbb8133344dafdd879cfe75ba0388 (patch) | |
tree | c6c80b9a6aa02184778a51e383c76025aa56096d | |
parent | 6a85079d3325c08d9e0b1c7c87afde4e9b0fb2c3 (diff) | |
download | dotfiles-de5439b63b9fbb8133344dafdd879cfe75ba0388.tar.gz dotfiles-de5439b63b9fbb8133344dafdd879cfe75ba0388.tar.bz2 dotfiles-de5439b63b9fbb8133344dafdd879cfe75ba0388.zip |
Add disable_touchpad script
Disables touchpad only if a TrackPoint is available.
Also to be used with pm-utils when resuming from suspend.
-rwxr-xr-x | .scripts/disable_touchpad.sh | 12 | ||||
-rw-r--r-- | .xinitrc | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/.scripts/disable_touchpad.sh b/.scripts/disable_touchpad.sh new file mode 100755 index 0000000..bd5b6d5 --- /dev/null +++ b/.scripts/disable_touchpad.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Only disbale Touchpad if there is a TrackPoint +xinput list | grep TrackPoint &> /dev/null || exit + +device_id=$(xinput list | sed -n "s/^.*Synaptics.*id=\([^\t]*\).*$/\\1/p") +[[ -z "$device_id" ]] && exit 1 + +enabled=$(xinput list-props $device_id | sed -n "s/^.*Device Enabled.*\t\(.*\)$/\\1/p") +property=$(xinput list-props $device_id | sed -n "s/^.*Device Enabled (\([^)]*\)).*$/\\1/p") + +[[ $enabled -eq 1 ]] && xinput set-prop $device_id $property 0 @@ -5,6 +5,8 @@ xset r rate 250 50 # Xdefault is splitted so load the splitted files at startup [[ -x ~/.scripts/set_xressources.sh ]] && ~/.scripts/set_xressources.sh +[[ -x ~/.scripts/disable_touchpad.sh ]] && ~/.scripts/disable_touchpad.sh + #chooser="/etc/X11/chooser.sh" #session=$(XSESSION="${1}" ${chooser}) #exec ${session:-$(${chooser})} |