summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.scripts/disable_touchpad.sh12
-rw-r--r--.xinitrc2
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
diff --git a/.xinitrc b/.xinitrc
index f928432..4556fcf 100644
--- a/.xinitrc
+++ b/.xinitrc
@@ -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})}