i3: add mod+t to toggle touchpad

This commit is contained in:
Théophile Bastian 2017-07-09 10:54:44 +02:00
parent 19bde413c2
commit 15e76d0f14
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#!/bin/bash
synclient=/usr/bin/synclient
prop='TouchpadOff'
if ! [ -x "$synclient" ]; then
exit 2
fi
state=$(${synclient} -l \
| grep "^ ${prop}" \
| sed 's/^.*= \([01]\)$/\1/g' \
| head -n 1)
if [ -z "$state" ] || $(echo "$state" | grep -vq '^[01]$') ; then
exit 1
fi
nState=$((($state + 1) % 2))
$synclient "$prop=$nState"

View File

@ -38,6 +38,9 @@ bindsym $mod+z exec ~/.config/i3/bin/i3lock
# kill focused window
bindsym $mod+Shift+q kill
# Toggle touchpad
bindsym $mod+t exec ~/.config/i3/bin/toggle-touchpad
## Specific applications
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run