Files
omarchycn/bin/omarchy-debug-idle
T
1ded25fd45 Make a dead lock client diagnosable and recoverable (#6630)
* Persist the Omarchy shell log across sessions

Quickshell only logs to its instance runtime dir on tmpfs, so when the
shell dies the idle/lock event trail is gone after a reboot (#6628).
Launch the shell through omarchy-launch-shell, which pipes stdout/stderr
into the journal under the omarchy-shell tag — bounded, timestamped, and
persistent — and surface that log in omarchy-debug-idle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Recover a locked session whose lock client died

When the shell dies while the session is locked, Hyprland's failsafe
keeps the session locked with no lock client left, and
omarchy-restart-shell refused to run in exactly that state, leaving
reboot as the only way back in (#6628). Gate the refusal on the lock
service actually holding (or acquiring) the lock rather than on the
session's LOCK state — a dead shell and a crash-handler relaunch that
holds no lock both fail that check — then restart the shell, re-acquire
the session lock, and wait for it to report secure, the same
secure-poll omarchy-system-sleep-lock uses, so the user can
authenticate out of the failsafe. Enable Hyprland's
allow_session_lock_restore so the compositor accepts the replacement
lock client.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 12:59:32 +02:00

62 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Show idle, screensaver, and lock diagnostics
# omarchy:group=debug
# omarchy:args=[log-lines]
# omarchy:examples=omarchy debug idle | omarchy-debug-idle 400
lines=${1:-200}
if [[ ! $lines =~ ^[0-9]+$ ]]; then
lines=200
fi
section() {
printf '\n== %s ==\n' "$1"
}
section "Time"
date -Is
section "Idle IPC status"
omarchy-shell idle status 2>&1 | jq . 2>/dev/null || omarchy-shell idle status 2>&1 || true
section "Quickshell instances"
quickshell list -p "$OMARCHY_PATH/shell" --any-display 2>&1 || true
section "Recent idle logs"
quickshell --no-color log -p "$OMARCHY_PATH/shell" --any-display --tail "$lines" --log-times -r 'quickshell.wayland.idle_notify=true' 2>&1 \
| grep -Ei 'omarchy idle|idle_notify|screensaver|lock|error|warn|failed' || true
section "Persisted shell log"
journalctl -t omarchy-shell -n "$lines" --no-pager --quiet 2>/dev/null || true
section "Relevant processes"
ps -eo pid=,args= \
| grep -E 'quickshell -n -p|omarchy-system-sleep-monitor|systemd-inhibit.*Lock screen before suspend|org\.omarchy\.screensaver|omarchy-screensaver|(^|/| )tte( |$)' \
| grep -v grep || true
section "Sleep lock service"
systemctl --user status omarchy-sleep-lock.service --no-pager 2>/dev/null || true
section "Hyprland screensaver clients"
hyprctl clients -j 2>/dev/null \
| jq -r '.[] | select(.class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver") | [.pid,.class,.initialClass,.title,.focusHistoryID] | @tsv' || true
section "Idle inhibitors"
hyprctl clients -j 2>/dev/null \
| jq -r '.[] | select(.inhibitingIdle == true or ((.tags // []) | index("noidle"))) | [.pid,.class,.title,((.tags // []) | join(",")),.inhibitingIdle] | @tsv' || true
section "Screensaver detector"
if hyprctl clients -j 2>/dev/null | jq -e '.[] | select(.class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null; then
echo "running-window"
elif pgrep -f '[o]rg.omarchy.screensaver' >/dev/null; then
echo "running-process"
elif omarchy-toggle-enabled screensaver-off; then
echo "disabled"
else
echo "stopped"
fi
section "Lock detector"
omarchy-shell lock status 2>&1 | jq . 2>/dev/null || omarchy-shell lock status 2>&1 || true