summaryrefslogtreecommitdiff
path: root/.local/bin/trackpadtoggle
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
commite371d9edd474bcf89cf5d462eaccb8638900b390 (patch)
treeed07118f5c514a55f23a779a1507640e46fd9ed2 /.local/bin/trackpadtoggle
Initial commit
Diffstat (limited to '.local/bin/trackpadtoggle')
-rwxr-xr-x.local/bin/trackpadtoggle15
1 files changed, 15 insertions, 0 deletions
diff --git a/.local/bin/trackpadtoggle b/.local/bin/trackpadtoggle
new file mode 100755
index 0000000..4bf01ae
--- /dev/null
+++ b/.local/bin/trackpadtoggle
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Give this the 1 argument to activate the Trackpad.
+# Give this 0 to disable it.
+
+input="$1"
+
+xinput --set-prop 12 "Device Enabled" $input
+
+case "$input" in
+ 0) notify-send -i "$HOME/.fonts/svg/mouse-pointer.svg" -a Trackpad "Trackpad successfully disabled" ;;
+ 1) notify-send -i "$HOME/.fonts/svg/mouse-pointer.svg" -a Trackpad "Trackpad successfully enabled" ;;
+ *) notify-send -i "$HOME/.fonts/svg/mouse-pointer.svg" -a Trackpad "Error" ;;
+esac
+