omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Silent lock-screen login loop when ~/.config/uwsm/env.d has a shell error (UWSM preloader fails with no UI)

Open austrasien opened this issue 2 months ago • 2 comments

System details

Framework Laptop 13 (AMD Ryzen AI 300 Series), AMD Radeon 840M, Omarchy 4.0.2-1, Hyprland 0.56.2, SDDM, uwsm 0.26.7-1, kernel 7.1.9-arch1-2

What's wrong?

A syntax error in any file under ~/.config/uwsm/env.d/ makes uwsm_env-preloader abort. On Omarchy (SDDM + UWSM + Hyprland) the user experience is:

  1. Boot reaches the Omarchy lock screen (password / fingerprint).
  2. Correct credentials accepted → brief loading → same lock screen again. Forever.
  3. No on-screen error. Looks like a wrong password / broken PAM / crashed lock.
  4. TTY (Ctrl+Alt+F2) login works; Hyprland never starts (hyprctl → no instance).
  5. Limine/Snapper snapshot rollback does not help: the bad file lives under /home.

Omarchy’s own stock UWSM drop-in tells users that overrides belong in ~/.config/uwsm/env.d/* (/usr/share/omarchy/default/uwsm/env.d/10-omarchy), so this is an easy footgun for anyone (or any agent) editing that path.

Journal

uwsm_env-preloader: Loading environment from "/home/<user>/.config/uwsm/env.d/<file>".
uwsm_env-preloader: ...: line 2: :${PATH:}:: bad substitution
uwsm_env-preloader: Env output mark "<hex>" not found in shell output

(:${PATH:}: was a typo for :${PATH}: — invalid bash ${VAR:} empty-offset form. Any sourcing error reproduces the same loop.)

Renaming in place to *.broken / *.bak still fails: UWSM’s source_dir loads every ls entry in env.d/. The file must be moved out of env.d/ entirely.

Steps to recreate

  1. Put a bad shell fragment in ~/.config/uwsm/env.d/99-bad (e.g. case ":${PATH:}:" in *) ;; esac).
  2. Reboot / re-auth at the lock screen.
  3. Observe endless lock loop; check journal for uwsm_env-preloader.
  4. mv the file out of env.d/ → session starts normally.

What Omarchy could do (even while UWSM fixes upstream)

Upstream report: https://github.com/Vladimir-csp/uwsm/issues/226

Omarchy-side asks:

  1. Docs / Manual warning — env.d is session-critical; a typo bricks graphical login with no UI; rename-in-place is not disable; TTY + journal is the recovery path; Snapper won’t save you if the file is in /home.
  2. Visible failure — if the UWSM session fails to start after successful auth, surface something on the greeter/lock (or a one-shot notify on TTY) instead of a silent re-lock.
  3. Optional: ship or document a tiny env.d preflight (bash -n / source in a subshell) before logout.

Happy to test any Omarchy-side messaging/docs changes.

austrasien avatar Sep 07 '26 20:09 austrasien

Thanks for the detailed write-up, the journal lines make the cause clear. #10708 is already open to document the recovery path, and #8669 is the same failure mode coming from an unguarded ~/.profile line. Both are worth following.

The bigger question is whether the session start should catch a failed uwsm_env-preloader and show an error instead of bouncing back to the lock screen. That's a product decision for the maintainer. In the meantime, the workaround is to log in on a TTY (Ctrl+Alt+F2), run bash -n ~/.config/uwsm/env.d/* to find the bad file, then fix it or move it aside.

jandrusk avatar Oct 13 '26 16:10 jandrusk

I read this report against the linked UWSM issue, #8669 and #10708. Nothing was run, since the class is not settled yet.

The cause is clear from your journal: uwsm_env-preloader aborts when a file in ~/.config/uwsm/env.d/ fails to source, and the session ends without showing anything. Of your three asks, the manual warning and recovery path are what #10708 proposes. A visible error after a failed session start, and an env.d preflight, would both be new behaviour.

This is not a duplicate of #8669. The symptom is the same, but there the failing line is one Omarchy's Rust install writes into ~/.profile, so that one needs a different fix.

The classification is unsettled. Claude Opus 5.5 read it as an enhancement, because the session failed on a hand-edited file and what is left is new error reporting. Codex Medium, asked separately, read it as a bug, because a config error leaves the login looping with no message. With the two disagreeing, it carries no class label. Whether Omarchy should catch this case is the maintainer's call, so it is waiting on them.

omarchybot avatar Oct 18 '26 01:10 omarchybot