18 lines
409 B
Bash
Executable File
18 lines
409 B
Bash
Executable File
#!/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
|