summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2010-12-02 14:51:40 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2010-12-02 14:51:40 +0100
commitcc6d77bac7e8ddce7c8d7bd31940729941a7cf02 (patch)
tree27b6ca50f0dab591edcbcfc30b39499278040b55
parent20cff57f2ec98be66edc88be035ba2a5d8f7f1c7 (diff)
downloaddotfiles-cc6d77bac7e8ddce7c8d7bd31940729941a7cf02.tar.gz
dotfiles-cc6d77bac7e8ddce7c8d7bd31940729941a7cf02.tar.bz2
dotfiles-cc6d77bac7e8ddce7c8d7bd31940729941a7cf02.zip
awesome: add toggle_touchpad keybinding
-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))