#!/bin/sh

id=$(xinput list | grep Touchpad | awk '{ print $6}' | cut -d '=' -f 2)

state=$(xinput list-props $id | grep "Device Enabled" | awk ' {print $4} ')

if [ $state = 1 ]; then
	dunstify -r 19 -a center --timeout=1500 -i "$pOS_NOTIF_IMG_DIR/touchpad-disabled.png" ""
	xinput set-prop $id "Device Enabled" 0
else
	dunstify -r 19 -a center --timeout=1500 -i "$pOS_NOTIF_IMG_DIR/touchpad-enabled.png" ""
	xinput set-prop $id "Device Enabled" 1
fi
