Protect against hyprlock crash when there are no screens at all
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user