Add hypr_mon_guard

This commit is contained in:
clsty
2025-11-13 01:05:18 +08:00
parent 1844d12bc5
commit 6889185c3e
3 changed files with 33 additions and 4 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/bash
# This script is to prevent hyprland from not responding to any input when no monitor is enabled.
# The shebang cannot be #!/usr/bin/env bash , idk why
while true; do
readarray -t enabled_mons < <(hyprctl -j monitors all | jq -r '.[] | select(.disabled == false) | .name')
#if -z "$enabled_mons"; then
if [ ${#enabled_mons[@]} -eq 0 ]; then
hyprctl reload
fi
sleep 10
done