mirror of
https://github.com/gaitas13/dotfiles.git
synced 2025-12-06 15:25:37 +01:00
24 lines
664 B
Bash
Executable file
24 lines
664 B
Bash
Executable file
#!/bin/bash
|
|
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
|
# For disabling touchpad.
|
|
|
|
Touchpad_Device="asue1209:00-04f3:319f-touchpad"
|
|
notif="$HOME/.config/swaync/images/bell.png"
|
|
|
|
XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
|
|
STATUS_FILE="$XDG_RUNTIME_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:$Touchpad_Device:enabled" "$(cat "$STATUS_FILE")"
|
|
}
|
|
|
|
toggle_touchpad
|