snowflake/bin/touchpad-toggle-xinput
2025-05-30 22:59:38 +08:00

15 lines
361 B
Bash
Executable File

#!/usr/bin/env bash
TPAD_ID=$(xinput | awk '/Touchpad/ {print $6}' | awk -F = '{print $2}')
is_enabled=$(xinput list-props $TPAD_ID | awk '/Device Enabled/ {print $4}')
if [[ $is_enabled == 0 ]]; then
xinput enable "$TPAD_ID"
status="Enabled"
else
xinput disable "$TPAD_ID"
status="Disabled"
fi
notify-send "Touchpad" "$status" -i "touchpad"