stow_dotfiles/hyprland/.config/hypr/scripts/TouchPad.sh
Matthieu Fortin (CPC/CCP) e281b79c5c hyprland config
2024-09-18 11:56:48 -04:00

32 lines
978 B
Bash
Executable file

#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# For disabling touchpad.
# Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system
# use hyprctl devices to get your system touchpad device name
# source https://github.com/hyprwm/Hyprland/discussions/4283?sort=new#discussioncomment-8648109
notif="$HOME/.config/swaync/images/bell.png"
export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
enable_touchpad() {
printf "true" >"$STATUS_FILE"
notify-send -u low -i $notif "Enabling touchpad"
hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r
}
disable_touchpad() {
printf "false" >"$STATUS_FILE"
notify-send -u low -i $notif "Disabling touchpad"
hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r
}
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