diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2023-10-22 15:55:57 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2023-10-22 15:55:57 +0900 |
| commit | c222e1bad2ba5e779c3af5b956906c82ead43271 (patch) | |
| tree | a5253e0861c200ff90354169e1f67ef42ebf0ef9 /config/hypr/scripts/TouchPad.sh | |
| parent | bb0be21dba7980fc1c047eaba24eda1712bd7f31 (diff) | |
Initial upload
Diffstat (limited to 'config/hypr/scripts/TouchPad.sh')
| -rwxr-xr-x | config/hypr/scripts/TouchPad.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/config/hypr/scripts/TouchPad.sh b/config/hypr/scripts/TouchPad.sh new file mode 100755 index 00000000..ab9f3c47 --- /dev/null +++ b/config/hypr/scripts/TouchPad.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# NOTE: find the right device using hyprctl devices + +HYPRLAND_DEVICE="asue1209:00-04f3:319f-touchpad" + +if [ -z "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR=/run/user/$(id -u) +fi + +export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" + +enable_touchpad() { + printf "true" > "$STATUS_FILE" + + notify-send -u normal "Enabling Touchpad" + + hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" true +} + +disable_touchpad() { + printf "false" > "$STATUS_FILE" + + notify-send -u normal "Disabling Touchpad" + + hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" false +} + +if ! [ -f "$STATUS_FILE" ]; then + enable_touchpad +else + if [ $(cat "$STATUS_FILE") = "true" ]; then + disable_touchpad + elif [ $(cat "$STATUS_FILE") = "false" ]; then + enable_touchpad + fi +fi |
