The lock service arms a 5s blank timer whenever the screen locks, and input at the lock screen re-arms it. Closing the lid sprays pointer noise over the lock surface, so the timer was routinely armed right before suspend, froze mid-countdown, and fired moments after resume -- blanking the freshly woken unlock screen under the user. Guard the timer with a wall-clock check: if far more time elapsed than the interval, the countdown slept through a suspend, so take a fresh run-up instead of blanking. This also blanks the lock screen 5s after an untouched resume. Two accomplices made the flash worse and hid the real bug: - The clamshell watcher's 2s poll fired an unconditional global DPMS enable whenever no external monitor was active, relighting any blank within 2 seconds (lock-screen blanking never stuck on undocked laptops) and racing the resume modeset. Recovery now only wakes displays when it actually re-enables one. - Every keystroke at the lock screen dispatched a redundant DPMS enable via omarchy-system-wake, forcing extra modesets in the fragile just-resumed DRM state. Brightness "on" now skips the dispatch when every active display is already lit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
85 lines
4.7 KiB
Bash
Executable File
85 lines
4.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
|
|
|
monitor_watch="$ROOT/bin/omarchy-hyprland-monitor-watch"
|
|
monitor_internal="$ROOT/bin/omarchy-hyprland-monitor-internal"
|
|
monitor_mirror="$ROOT/bin/omarchy-hyprland-monitor-internal-mirror"
|
|
monitor_external_active="$ROOT/bin/omarchy-hyprland-monitor-external-active"
|
|
sleep_lock="$ROOT/bin/omarchy-system-sleep-lock"
|
|
system_wake="$ROOT/bin/omarchy-system-wake"
|
|
clamshell="$ROOT/bin/omarchy-hyprland-monitor-clamshell"
|
|
lock_service="$ROOT/shell/plugins/lock/Service.qml"
|
|
hw_clamshell="$ROOT/bin/omarchy-hw-clamshell"
|
|
utilities="$ROOT/default/hypr/bindings/utilities.lua"
|
|
|
|
grep -F 'sleep "$delay"' "$monitor_watch" >/dev/null
|
|
grep -F 'for delay in 1 3 7; do' "$monitor_watch" >/dev/null
|
|
grep -F 'poll_clamshell_state &' "$monitor_watch" >/dev/null
|
|
grep -F 'flock -n 9' "$monitor_watch" >/dev/null
|
|
grep -F 'omarchy-hyprland-monitor-clamshell' "$monitor_watch" >/dev/null
|
|
pass "monitor watcher retries internal monitor recovery after removal"
|
|
|
|
grep -F 'monitoradded\>\>*|monitoraddedv2\>\>*)' "$monitor_watch" >/dev/null
|
|
grep -F 'omarchy-hyprland-monitor-clamshell' "$monitor_watch" >/dev/null
|
|
pass "monitor watcher disables the internal monitor after closed-lid external hotplug"
|
|
|
|
grep -F 'sync_clamshell_after_monitor_change' "$monitor_watch" >/dev/null
|
|
grep -F 'socat -U - "UNIX-CONNECT:$SOCKET"' "$monitor_watch" >/dev/null
|
|
pass "monitor watcher reconciles clamshell state on startup"
|
|
|
|
grep -F '/proc/acpi/button/lid/*/state' "$hw_clamshell" >/dev/null
|
|
grep -F 'omarchy-hw-external-monitors' "$hw_clamshell" >/dev/null
|
|
pass "clamshell helper detects closed-lid external monitor state"
|
|
|
|
grep -F 'hyprctl monitors -j' "$monitor_external_active" >/dev/null
|
|
grep -F 'select(.name | test("^(eDP|LVDS|DSI)-") | not)' "$monitor_external_active" >/dev/null
|
|
grep -F 'select(.disabled == false)' "$monitor_external_active" >/dev/null
|
|
pass "active external monitor helper checks Hyprland outputs"
|
|
|
|
grep -F 'omarchy-hyprland-monitor-internal recover >/dev/null 2>&1 || true' "$clamshell" >/dev/null
|
|
grep -F 'omarchy-hyprland-monitor-internal-mirror recover >/dev/null 2>&1 || true' "$clamshell" >/dev/null
|
|
grep -F 'internal-monitor-clamshell.lua' "$clamshell" >/dev/null
|
|
grep -F 'disabled = true' "$clamshell" >/dev/null
|
|
grep -F 'MANUAL_DISABLE_FLAG' "$clamshell" >/dev/null
|
|
! grep -F 'rm -f "$MANUAL_DISABLE_FLAG"' "$clamshell" >/dev/null
|
|
! grep -F '>"$MANUAL_DISABLE_FLAG"' "$clamshell" >/dev/null
|
|
grep -F 'read_monitor_scale' "$clamshell" >/dev/null
|
|
grep -F 'scale = $scale' "$clamshell" >/dev/null
|
|
grep -F 'hyprctl dispatch "hl.dsp.dpms({ action = \"$action\", monitor = \"$INTERNAL\" })"' "$clamshell" >/dev/null
|
|
grep -F 'hyprctl monitors all -j' "$clamshell" >/dev/null
|
|
grep -F 'omarchy-hyprland-monitor-external-active' "$clamshell" >/dev/null
|
|
grep -F 'omarchy-hw-clamshell' "$clamshell" >/dev/null
|
|
pass "clamshell monitor sync disables laptop output and force-recovers it"
|
|
|
|
grep -F "hyprctl dispatch 'hl.dsp.dpms({ action = \"enable\" })' >/dev/null 2>&1 || true" "$monitor_internal" >/dev/null
|
|
grep -F 'hyprctl monitors all -j' "$monitor_internal" >/dev/null
|
|
grep -F 'omarchy-hyprland-monitor-external-active' "$monitor_internal" >/dev/null
|
|
grep -F 'wake' "$monitor_internal" >/dev/null
|
|
grep -F 'omarchy-hyprland-toggle-enabled $TOGGLE || return 0' "$monitor_internal" >/dev/null
|
|
pass "internal monitor helper can re-enable disabled laptop displays"
|
|
pass "internal monitor recovery only wakes displays when it re-enables one"
|
|
|
|
grep -F 'omarchy-hyprland-monitor-external-active' "$monitor_mirror" >/dev/null
|
|
pass "internal mirror helper recovers when no active external display remains"
|
|
|
|
grep -F 'switch:on:Lid Switch", nil, "omarchy-hyprland-monitor-clamshell"' "$utilities" >/dev/null
|
|
grep -F 'switch:off:Lid Switch", nil, "omarchy-hyprland-monitor-clamshell"' "$utilities" >/dev/null
|
|
pass "lid switch bindings reconcile clamshell display state"
|
|
|
|
grep -F 'omarchy-hyprland-monitor-clamshell >/dev/null 2>&1 || true' "$sleep_lock" >/dev/null
|
|
grep -F '(( attempt % 5 == 0 )) && sync_clamshell' "$sleep_lock" >/dev/null
|
|
pass "sleep lock syncs clamshell display state while waiting for secure lock"
|
|
|
|
grep -F 'omarchy-hyprland-monitor-clamshell >/dev/null 2>&1 || true' "$system_wake" >/dev/null
|
|
pass "system wake resyncs clamshell display state"
|
|
|
|
grep -F 'lock-pending: no-real-screen' "$lock_service" >/dev/null
|
|
grep -F 'lock-pending: screen-stabilizing' "$lock_service" >/dev/null
|
|
grep -F 'id: sessionLockStabilizeTimer' "$lock_service" >/dev/null
|
|
grep -F 'function onScreensChanged() { root.requestSessionLock() }' "$lock_service" >/dev/null
|
|
grep -F 'realScreens: root.realScreenCount()' "$lock_service" >/dev/null
|
|
pass "lock service waits for stable real screens before session lock"
|