Skip to content

feat(login): open the disk prompt's desktop from the login screen - #13

Merged
lbssousa merged 1 commit into
mainfrom
feat/login-once
Nov 10, 2026
Merged

lbssousa merged 1 commit into
mainfrom
feat/login-once

Conversation

@lbssousa

@lbssousa lbssousa commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Problem

SDDM's automatic login runs before any greeter, so the desktop it opens takes the display's VT, the first console (Display::startAuth only sets up a new VT when the greeter is running). SDDM 0.21 then fails to show any later login screen there, so Switch User from a desktop the disk prompt opened asked for a logout first.

Change

The disk prompt's choice no longer goes through SDDM's [Autologin]:

  • omarchy-mu-login-select writes a one-time pass to /run/omarchy-multiuser/login-once (user, boot id, time; root's only, mode 600) and sets [Last] User= in SDDM's state.conf, keeping the rest of that file, its owner and its mode. --clear also removes the pass and the 0.11.0 drop-in.
  • New omarchy-mu-login-once, as two lines first in /etc/pam.d/sddm:
    • [success=done default=ignore] … omarchy-mu-login-once: succeeds for an empty password only, with a pass for that user, this boot, at most 60 s old, root-owned and not a link. The first empty password takes the pass, right or wrong. It also makes the pam_nologin and pam_shells checks that success=done skips. pam_env runs again at session.
    • [success=die default=ignore] … omarchy-mu-login-once --empty: any other empty password ends the attempt, with no pam_unix delay and no faillock strike.
  • Greeter: as it comes up, it tries sddm.login(lastUser, "") once and shows nothing if that fails. An Enter pressed meanwhile is sent afterwards. SDDM gives that session a new VT, as it does for any login at the login screen, so the first console stays free for later greeters.
  • omarchy-mu-sddm-guard keeps both lines right before omarchy-mu-login-match, and moves them back there if they end up elsewhere. Removing the package takes them out.

Another SDDM theme makes no such try and shows the login screen. The first-console check in Switch User stays, for desktops still put there by SDDM's own automatic login (/etc/sddm.conf or another tool).

Note: pam_exec's expose_authtok writes the password without a trailing NUL, so an empty password arrives as no bytes at all. omarchy-mu-login-once reads it that way, and the tests feed it in that form.

Testing

  • just test: JS and shell suites (13 new tests: login-once.test.sh, state.conf handling, the guard's PAM lines), shellcheck, qmllint, greeter smoke, visudo
  • makepkg with check(), installed: the guard added both PAM lines in the expected order
  • Reboot unlocking with one person's password: their desktop opens by itself on tty2
  • Switch User from that desktop shows the login screen with no logout
  • Reboot unlocking with another person's password opens theirs

🤖 Generated with Claude Code

SDDM's automatic login put that desktop on the first console, where
SDDM 0.21 then fails to show any later login screen. Switching users
from it meant logging out first.

omarchy-mu-login-select now leaves a one-time pass instead
(/run/omarchy-multiuser/login-once: user, boot id, time) and makes that
user SDDM's last one. The greeter logs them in as it comes up, with an
empty password, and the new omarchy-mu-login-once, first in SDDM's PAM
stack, lets that one login through: their name, this boot, the last
minute, the pass taken by the first try, and the nologin and shell
checks that success=done skips. An empty password with no pass ends
the attempt without pam_unix's delay or a faillock strike. The desktop
gets a console of its own, as any login at the login screen does.

omarchy-mu-sddm-guard keeps both PAM lines right before
omarchy-mu-login-match, and removing the package takes them out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lbssousa
lbssousa merged commit c42e254 into main Nov 10, 2026
1 check passed
@lbssousa
lbssousa deleted the feat/login-once branch November 10, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant