2025-03-03 09:01:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
device=znt0001:00-14e5:650e-touchpad
|
|
|
|
toggle_variable="device[${device}]:enabled"
|
|
|
|
|
|
|
|
hyprctl keyword "${toggle_variable}" true
|
|
|
|
|
2025-04-04 12:16:07 +02:00
|
|
|
status_file="$HOME/.config/hypr/status/touchpad"
|
2025-03-03 09:01:51 +01:00
|
|
|
|
|
|
|
enable_touchpad() {
|
2025-04-04 12:16:07 +02:00
|
|
|
printf "on" > "${status_file}"
|
2025-03-03 09:01:51 +01:00
|
|
|
|
|
|
|
hyprctl notify 1 2000 0 "Enabled touchpad"
|
|
|
|
|
|
|
|
hyprctl keyword "${toggle_variable}" true
|
|
|
|
}
|
|
|
|
|
|
|
|
disable_touchpad() {
|
2025-04-04 12:16:07 +02:00
|
|
|
printf "off" > "${status_file}"
|
2025-03-03 09:01:51 +01:00
|
|
|
|
|
|
|
hyprctl notify 0 2000 0 "Disabled Touchpad"
|
|
|
|
|
|
|
|
hyprctl keyword "${toggle_variable}" false
|
|
|
|
}
|
|
|
|
|
|
|
|
if ! [ -f "${status_file}" ]; then
|
2025-04-04 12:16:07 +02:00
|
|
|
hyprctl notify 3 3000 0 "Status file missing"
|
2025-03-03 09:01:51 +01:00
|
|
|
enable_touchpad
|
|
|
|
else
|
2025-04-04 12:16:07 +02:00
|
|
|
if [ $(cat "${status_file}") = "on" ]; then
|
2025-03-03 09:01:51 +01:00
|
|
|
disable_touchpad
|
2025-04-04 12:16:07 +02:00
|
|
|
elif [ $(cat "${status_file}") = "off" ]; then
|
2025-03-03 09:01:51 +01:00
|
|
|
enable_touchpad
|
|
|
|
fi
|
|
|
|
fi
|