Files
hyprland/config/hypr/UserScripts/TouchPad.sh
T
2024-01-09 14:05:16 +05:45

28 lines
598 B
Bash
Executable File

#!/bin/bash
# For disabling touchpad.
notif="$HOME/.config/swaync/images/bell.png"
# NOTE: find the right device using hyprctl devices
HYPRLAND_DEVICE="dll07a7:01-044e:120b"
DIR=$HOME/.cache
STATUS_FILE="$DIR/touchpad.status"
toggle_touchpad() {
if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then
echo "true" > "$STATUS_FILE"
action="enabled"
else
echo "false" > "$STATUS_FILE"
action="disabled"
fi
notify-send -u low -i "$notif" "Touchpad $action"
hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" "$(cat "$STATUS_FILE")"
}
toggle_touchpad