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

Fix the pre-suspend lock never firing because a Homebrew dbus-monitor shadows the system one

omarchylaptophomebrewsystemddbus
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 issue #7412 in full (open, no comments). It supports the mechanism, the journal line, the NRestarts/SubState evidence and the unconditional exit 0 in the --inhibited branch. Confirmed on this workstation (4.0.4-1, upstream latest v4.0.4) that /usr/share/omarchy/bin/omarchy-system-sleep-monitor calls bare dbus-monitor and is byte-identical to quattro, that the unit is Restart=always RestartSec=2, and that autostart.lua line 3 runs systemctl --user import-environment of the whole session env. Every binary the lock path calls (omarchy-shell, omarchy-notification-send, omarchy-hyprland-monitor-clamshell, busctl, jq, timeout) is in /usr/bin, so the PATH drop-in is sound. Two things were wrong. The symptom says the laptop wakes unlocked after every suspend, which the issue does not claim: a lid close with no external monitor still locks through the Hyprland binding switch:on:Lid Switch -> omarchy-system-lid-close -> omarchy-system-lock, which does not depend on dbus-monitor. The suspends that go through unlocked are the ones with no separate lock, such as the System menu's Suspend, which is plain systemctl suspend in default/omarchy/omarchy-menu.jsonc. For the same reason the verify step (lid close then open shows the lock screen) passes with or without the fix, so it was replaced. The drop-in was not exercised. Whether Homebrew's PATH reaches the user manager depends on where the shellenv line lives, and that rests on the reporter's evidence only.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.

Symptom

Suspending from the System menu (Super+Escape, Suspend) or with systemctl suspend wakes onto the unlocked desktop, and no "Screen did not lock before suspend" notification appears. A lid close with no external monitor still locks, because the Hyprland lid binding locks through a separate path. systemctl --user show omarchy-sleep-lock.service -p NRestarts,SubState shows thousands of restarts and SubState=auto-restart. journalctl --user -u omarchy-sleep-lock.service repeats every 2 seconds: Failed to open connection to system bus: Failed to connect to socket /home/linuxbrew/.linuxbrew/var/run/dbus/system_bus_socket: No such file or directory. Homebrew on Linux is installed with its brew shellenv line in the shell profile.

Cause

omarchy-system-sleep-monitor starts dbus-monitor --system by bare name. Omarchy's autostart.lua imports the whole session environment into the systemd user manager (systemctl --user import-environment $(env | cut -d'=' -f 1)), so a PATH with Homebrew's bin ahead of /usr/bin reaches omarchy-sleep-lock.service. Homebrew's dbus formula builds a dbus-monitor whose default system-bus socket is under the Homebrew prefix, so it exits at once. The script's --inhibited branch then exits 0 regardless, and Restart=always with RestartSec=2 starts it again, forever. omarchy-system-sleep-lock is never reached, so no lock is requested and no failure notification is sent. Any other dbus-monitor earlier in PATH would behave the same way. Confirmed on 4.0.4-1 that the monitor still calls bare dbus-monitor and is byte-identical to quattro. Issue #7412 is open.

Fix

**1. Confirm the shadowing:**


systemctl --user show-environment | grep '^PATH='
which -a dbus-monitor
systemctl --user show omarchy-sleep-lock.service -p NRestarts,SubState

**2. Pin a system PATH for this one unit.** A unit's Environment= overrides the variable imported into the user manager. Everything the lock path calls (omarchy-system-sleep-lock, omarchy-shell, omarchy-notification-send, busctl, jq, dbus-monitor) is in /usr/bin on Omarchy 4:


mkdir -p ~/.config/systemd/user/omarchy-sleep-lock.service.d
cat > ~/.config/systemd/user/omarchy-sleep-lock.service.d/10-system-path.conf <<'EOF'
[Service]
Environment=PATH=/usr/local/bin:/usr/bin
EOF
systemctl --user daemon-reload
systemctl --user restart omarchy-sleep-lock.service

The alternative is to remove Homebrew's dbus formula, but other formulae may depend on it, so the drop-in is the less disruptive change.

Do not disable or mask the unit to stop the restart noise. It is the only thing that locks the session before suspend.

Verify

systemctl --user show omarchy-sleep-lock.service -p NRestarts,SubState shows SubState=running and the count stops climbing. systemd-inhibit --list --what=sleep lists Omarchy with Lock screen before suspend. Suspend from the System menu (Super+Escape, then Suspend), not with the lid, because a lid close locks through a different path even while this unit is broken. On wake the lock screen is showing.

Sources

omarchy-sleep-lock-restart-loop-shadowed-dbus-monitor