dotfiles/home/Scripts/touchpadtoggle.sh
Marko Korhonen b1335a3628 Removed commit history
Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
2019-10-26 20:05:31 +03:00

27 lines
592 B
Bash
Executable file

#!/bin/sh
gr="FocalTechPS/2 FocalTech Touchpad"
#gr="SynPS/2 Synaptics TouchPad"
#Creates a file if it does not exist to store the 0 or 1 bit to check if touchpad is enabled or disabled. Set to 0 by default
if [ ! -f .touchpad ];
then
echo 0 > .touchpad;
fi
if grep -q 0 ".touchpad";
then
xinput enable "$gr";
echo 1 > .touchpad;
echo "Touchpad enabled"
notify-send "Touchpad enabled"
else
xinput disable "$gr";
echo 0 > .touchpad;
echo "Touchpad Disabled"
notify-send "Touchpad disabled"
fi