summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/awesome/awesome.lua1
-rwxr-xr-x.scripts/toggle_touchpad.sh9
2 files changed, 10 insertions, 0 deletions
diff --git a/.config/awesome/awesome.lua b/.config/awesome/awesome.lua
index 3ce2842..c42f004 100644
--- a/.config/awesome/awesome.lua
+++ b/.config/awesome/awesome.lua
@@ -226,6 +226,7 @@ globalkeys = awful.util.table.join(
awful.key({ modkey, }, "Print", function () awful.util.spawn("scrot -s") end),
awful.key({ }, "XF86Suspend", function () awful.util.spawn("sudo pm-suspend") end),
+ awful.key({}, "XF86TouchpadToggle", function () awful.util.spawn(os.getenv("HOME") .. "/.scripts/toggle_touchpad.sh") end),
awful.key({ modkey, "Shift" }, "r", awesome.restart),
diff --git a/.scripts/toggle_touchpad.sh b/.scripts/toggle_touchpad.sh
new file mode 100755
index 0000000..aca2d56
--- /dev/null
+++ b/.scripts/toggle_touchpad.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+device_id=$(xinput list | sed -n "s/^.*Synaptics.*id=\([^\t]*\).*$/\\1/p")
+
+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")
+
+
+xinput set-prop $device_id $property $((1-enabled))