23 lines
494 B
Bash
23 lines
494 B
Bash
HYPRLAND_DEVICE="$1"
|
|
export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
|
|
|
|
enable_touchpad() {
|
|
echo -n "true" >"$STATUS_FILE"
|
|
hyprctl keyword "device[$HYPRLAND_DEVICE]:enabled" true
|
|
}
|
|
|
|
disable_touchpad() {
|
|
echo -n "false" >"$STATUS_FILE"
|
|
hyprctl keyword "device[$HYPRLAND_DEVICE]:enabled" false
|
|
}
|
|
|
|
if ! [ -f "$STATUS_FILE" ]; then
|
|
disable_touchpad
|
|
else
|
|
if [ "$(<"$STATUS_FILE")" = "true" ]; then
|
|
disable_touchpad
|
|
elif [ "$(<"$STATUS_FILE")" = "false" ]; then
|
|
enable_touchpad
|
|
fi
|
|
fi
|