configuration form the arch linux stored
This commit is contained in:
17
polybar/scripts/touchpad-toggle.sh
Executable file
17
polybar/scripts/touchpad-toggle.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -i ID
|
||||
ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
|
||||
# ID=16
|
||||
declare -i STATE
|
||||
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
|
||||
if [ $STATE -eq 1 ]
|
||||
then
|
||||
xinput disable $ID
|
||||
echo "Touchpad disabled."
|
||||
notify-send "Touchpad disabled"
|
||||
else
|
||||
xinput enable $ID
|
||||
echo "Touchpad enabled."
|
||||
notify-send "Touchpad enabled"
|
||||
fi
|
||||
Reference in New Issue
Block a user