blob: 8f633ee050225e485ac40c1584323efd2e8cf089 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/bash
dunst_notif="$HOME/.config/dunst/images/bell.png"
# 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"
dunstify -u low -i "$dunst_notif" "Enabling Touchpad"
hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" true
}
disable_touchpad() {
printf "false" > "$STATUS_FILE"
dunstify -u low -i "$dunst_notif" "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
|