-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtouchpad
More file actions
executable file
·29 lines (25 loc) · 828 Bytes
/
touchpad
File metadata and controls
executable file
·29 lines (25 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
tapchange(){
xinput set-prop $device $prop $1
}
device=`xinput | grep -Po "Synaptics TouchPad\s+id=\K[\d]+"`
prop=`xinput --list-props $device | grep -Po 'Tapping Enabled \(\K[\d]+'`
deviceStatus=$(xinput --list-props $device | awk '/Device Enabled/ {print $4}' | head -n 1)
[[ -z $1 ]] && choice=$(echo -e "enable\ndisable" | dmenu -p "Select choice: " ) || choice=$1
if [[ $choice == enable || $1 == -e ]];then
xinput --enable $device
tapchange 1
elif [[ $choice == disable || $1 == -d ]];then
xinput --disable $device
elif [[ $choice == toggle || $1 == -t ]];then
if [[ $deviceStatus == 1 ]];then
xinput --disable $device
else
xinput --enable $device
tapchange 1
fi
elif [[ $choice == refresh || $1 == -r ]];then
xinput --disable $device
xinput --enable $device
tapchange 1
fi