OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
power-suspend high rare DISPUTE

Fix 'Screen did not lock before suspend' when logind is still enforcing a 5 second delay window

omarchylaptopsystemdhyprlandwayland
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy omarchy 4.0.4-1 on 2026-10-05
AUDIT NOTE

Read /usr/share/omarchy/bin/omarchy-system-sleep-lock and omarchy-system-sleep-monitor (byte-identical to quattro), the drop-in /etc/systemd/logind.conf.d/20-inhibit-delay.conf (InhibitDelayMaxSec=15, identical to quattro) and migration 1784970000.sh. The arithmetic, the notification text, the stderr line, the 12000 ms cap, the reload-then-reboot-flag behaviour and CanReload=yes on systemd-logind all hold. This machine reads InhibitDelayMaxUSec t 15000000. What the record misses: derive_budget_ms reads the property with timeout 1s busctl ... at the moment PrepareForSleep arrives, and if that read fails or times out it assumes window=5000000, which also gives exactly 4000 ms. So the cause's "a 4000 ms budget therefore means logind is enforcing the 5 second default" is wrong as stated: a 4000 ms message with logind reading 15000000 afterwards points at a failed read during sleep preparation, which a reload does not fix and the script does not log separately. The cause and fix are rewritten to cover both branches. Not exercised: no suspend, no reload.

The cause above was rewritten on 2026-10-05 to match this note; the fix was corrected by the audit itself.
RISK

Do not restart systemd-logind on Omarchy 4. It ends the graphical session and loses unsaved work.

Symptom

After resume the desktop is unlocked and a critical notification says "Screen did not lock before suspend", with the body "The session was left unlocked (the shell did not secure the session within 4000ms)." It happens mostly on lid close, especially when closing the lid also switches a display off. journalctl --user -u omarchy-sleep-lock.service shows omarchy-system-sleep-lock: suspending without a secure lock (the shell did not secure the session within 4000ms).

Cause

Omarchy locks before suspend from omarchy-sleep-lock.service, which holds a logind delay inhibitor and runs omarchy-system-sleep-lock when PrepareForSleep arrives. A delay inhibitor is a timer: logind suspends anyway when InhibitDelayMaxSec expires. The script reads logind's live InhibitDelayMaxUSec with a 1 second busctl call and keeps a reserve for logind, so its budget is the window minus a fifth of it (never less than 1 second), capped at 12 seconds. A 4000 ms budget comes from one of two things. Either logind is enforcing systemd's default 5 second window rather than the 15 seconds omarchy-settings ships in /etc/systemd/logind.conf.d/20-inhibit-delay.conf, or the busctl read failed or took longer than 1 second at sleep time, in which case the script assumes 5 seconds and logs nothing to say so. For the first: logind only reads drop-ins at start or on reload. The update that added the drop-in relies on migration 1784970000.sh to reload logind, and when that reload does not take, the migration only sets the reboot-required flag, so the old window stays until a reboot. A local drop-in that sorts after 20- and sets a smaller value has the same effect. The upstream comment in the drop-in says 5 seconds is not enough when a lid close also reconfigures displays. This is distinct from the stalled-lock latch (corpus slug stalled-lock-latch-suspends-unlocked), which exhausts the full 12000 ms budget. Budget arithmetic and the fallback read from /usr/share/omarchy/bin/omarchy-system-sleep-lock on 4.0.4-1, byte-identical to quattro.

Fix

**1. Read the window logind is actually enforcing.** No root needed:


busctl get-property org.freedesktop.login1 /org/freedesktop/login1 \
  org.freedesktop.login1.Manager InhibitDelayMaxUSec
# t 15000000 is Omarchy's value. t 5000000 is systemd's default and gives the 4000 ms budget.
systemd-analyze cat-config systemd/logind.conf | grep -E '^# /|InhibitDelayMaxSec'
pacman -Qkk omarchy-settings 2>&1 | grep logind

**2. If the drop-in is present but logind reports 5000000**, reload logind. Reload, never restart, because restarting systemd-logind tears down the graphical session:


sudo systemctl reload systemd-logind

Read the property again. A reboot also applies it.

**3. If a later drop-in overrides it**, the cat-config output shows which file sets InhibitDelayMaxSec last. Remove that line, or set it to 15 or more, then reload as above.

**4. If pacman -Qkk reports the Omarchy drop-in missing**, recreate it with the shipped setting and reload:


sudo install -Dm644 /dev/stdin /etc/systemd/logind.conf.d/20-inhibit-delay.conf <<'EOF'
[Login]
InhibitDelayMaxSec=15
EOF
sudo systemctl reload systemd-logind

**5. If logind already reports 15000000 and you still got the 4000 ms message**, the script's own read of the window failed or took over 1 second while the machine was preparing to sleep, and it fell back to assuming 5 seconds. Nothing on the logind side fixes that. Check what else was happening at that suspend:


journalctl -b --since '-1h' -u systemd-logind
journalctl --user -b -u omarchy-sleep-lock.service

and report it upstream with that output, since the script does not log the failed read separately.

Raising the window above 15 seconds does not extend the lock wait, because the script caps its own budget at 12 seconds.

Verify

busctl get-property ... InhibitDelayMaxUSec prints t 15000000. After the next lid close and open, the lock screen is showing and journalctl --user -u omarchy-sleep-lock.service -b | grep 'suspending without a secure lock' prints nothing.

Sources

omarchy-sleep-lock-4000ms-budget-logind-not-reloaded