[sxhkd] shortcut for [dis/en]abling the touchpad
authorAmin Bandali <me@aminb.org>
Thu, 19 Mar 2015 18:49:06 +0000 (14:49 -0400)
committerAmin Bandali <me@aminb.org>
Thu, 19 Mar 2015 18:49:06 +0000 (14:49 -0400)
can disable the touchpad and hide the pointer
requires synclient for disabling the touchapd and
unclutter for hiding the mouse

sxhkd/.config/sxhkd/sxhkdrc
sxhkd/.local/bin/toggle-mouse [new file with mode: 0755]

index aaf37e4..13734ef 100644 (file)
@@ -140,3 +140,6 @@ XF86AudioMute
 
 XF86LaunchA
   toggle-layout
 
 XF86LaunchA
   toggle-layout
+
+XF86LaunchB
+  toggle-mouse
diff --git a/sxhkd/.local/bin/toggle-mouse b/sxhkd/.local/bin/toggle-mouse
new file mode 100755 (executable)
index 0000000..906fdbb
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+touchpad_off="$(synclient -l | grep TouchpadOff | cut -d'=' -f 2 | xargs)"
+
+if [ "$touchpad_off" = "0" ]; then
+    synclient TouchpadOff=1
+    unclutter -idle 1 &
+else
+    synclient TouchpadOff=0
+    killall unclutter
+fi