Protect against hyprlock crash when there are no screens at all

This commit is contained in:
David Heinemeier Hansson
2026-06-22 19:28:43 +02:00
parent 62ada9e9ec
commit 8f5336e0d5
3 changed files with 76 additions and 5 deletions
+7 -2
View File
@@ -10,12 +10,17 @@ if [[ ! $wait_attempts =~ ^[0-9]+$ ]] || (( wait_attempts < 1 )); then
wait_attempts=100
fi
omarchy-hyprland-monitor-internal recover >/dev/null 2>&1 || true
omarchy-hyprland-monitor-internal-mirror recover >/dev/null 2>&1 || true
recover_internal_monitor_toggles() {
omarchy-hyprland-monitor-internal recover >/dev/null 2>&1 || true
omarchy-hyprland-monitor-internal-mirror recover >/dev/null 2>&1 || true
}
recover_internal_monitor_toggles
omarchy-shell lock lock >/dev/null 2>&1 || exit 1
for (( attempt = 0; attempt < wait_attempts; attempt++ )); do
(( attempt % 5 == 0 )) && recover_internal_monitor_toggles
status=$(omarchy-shell lock status 2>/dev/null || true)
if jq -e '.secure == true' <<<"$status" >/dev/null 2>&1; then