i3: add mod+t to toggle touchpad
This commit is contained in:
parent
19bde413c2
commit
15e76d0f14
2 changed files with 23 additions and 0 deletions
20
files/.config/i3/bin/toggle-touchpad
Executable file
20
files/.config/i3/bin/toggle-touchpad
Executable 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"
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue