Standalone greetd testing
Build and install the real-login harness, capture displays, inspect logs, and recover safely.
The standalone test harness in scripts/greetd-test/ installs into /opt/akari-test. It runs the production backend against real greetd and systemd-logind while keeping your existing display manager configuration intact and arming automatic recovery timers.
Because the harness uses the production backend, power actions (Suspend, Reboot, PowerOff) execute on the real host. Use akari run for mock authentication and mock power during ordinary desktop development.
User session environment
Shell & profile initialization
Production and test greetd configurations enable source_profile:
greetdloads/etc/profileand~/.profile.- Akari forwards the authenticated user’s session command to
$SHELLin non-interactive login mode (bash,sh,zsh,ksh,dash,ash, andfishrun via-l -c; non-POSIX shells such asnuortcsh/cshfall back cleanly through/bin/sh -lor direct desktop execution). - Your login shell loads its native login files (such as
.zprofileor fish config outsidestatus is-interactive; interactive.zshrcis not read). - The user-side executor preserves
argv, setsLANG=C.UTF-8only whenLANGis unset/empty, and launches the desktop.
Upgrading older installations
Installations preserve existing /etc/akari/greetd.toml files. When upgrading an older setup, remove source_profile = false (or set source_profile = true). Reinstalling the test harness updates its config and backend together.
Session & startup logs
| Log file | Location | Contents |
|---|---|---|
startup-*.log | ${XDG_STATE_HOME:-$HOME/.local/state}/akari/sessions/ | Native login shell stdout/stderr before desktop launch |
session-*.log | ${XDG_STATE_HOME:-$HOME/.local/state}/akari/sessions/ | Desktop process stdout/stderr and launch metadata |
lifecycle.log | Greeter session log directory | Greeter startup and shutdown diagnostics |
Native DRM/KMS splash
On real VTs, akari-splash renders a pure black (#000000) loading screen via libseat and DRM/KMS before Sway starts and again before the user desktop starts:
- Minimum hold: Defaults to 3 seconds from first presentation. Set
AKARI_SPLASH_DURATIONin the greeter launcher environment to adjust both transitions (0disables the hold). - Sway background handoff: The supplied Sway config displays a saved snapshot (
output * bg "$AKARI_LOG_DIR/splash.png" fit #000000) viaswaybgwhile Flutter initializes. - Console cleanup: Terminal text and scrollback are cleared before releasing the VT. See the login handoff proposal for hardware acceptance checks.
Facial authentication
PAM integration boundary
Akari integrates with facial and biometric authentication through the standard Linux PAM (Pluggable Authentication Modules) stack via greetd:
- PAM-owned biometrics: Camera access, liveness detection, and model inference run inside dedicated PAM modules and their system daemons. Neither the Flutter frontend nor the Rust backend accesses sensor hardware or biometric templates.
- Status forwarding & direct login: When the greeter wakes with a selected user, Akari starts the PAM conversation and forwards any
infoorerrorstatus messages over D-Bus. If PAM succeeds without requesting input, Akari launches the user desktop immediately. - Password fallback: If recognition times out or fails, PAM advances to the next module in its stack (typically password authentication) and Akari focuses the credential field under the same
attempt_id.
Reference implementation: Gaze
Akari validates facial authentication against Gaze and includes CLI helpers (akari login enable-gaze and akari login disable-gaze) that configure an isolated akari-gaze PAM substack with automatic backups and rollback.
Install and verify Gaze
-
On Arch Linux, install
gaze-bin(not the unrelatedgazefile watcher) and opt out of automaticsudoPAM modification if you only want to testgreetd:sudo install -d -m 0755 /etc/gaze sudo touch /etc/gaze/pam-sudo.optout yay -S --needed gaze-bin sudo systemctl enable --now gazed gaze configRecommended initial Gaze config
Start with CPU inference,
security.level = "medium", liveness enabled, and your RGB camera (usb:VVVV:PPPPidentifier preferred over/dev/video*). See Gaze’s installation and configuration guides. -
Enroll your face and test recognition from your desktop login account before touching PAM:
gaze add-face default gaze auth --verbose gaze doctor
Connect greetd on Arch
Once gaze auth succeeds, wire Gaze into the stock Arch greetd PAM stack:
akari login enable-gaze --dry-run
akari login enable-gaze
What enable-gaze does:
- Backs up
/etc/pam.d/greetdto/var/lib/akari/greetd.pam.before-gaze. - Writes
/etc/pam.d/akari-gazeand replacesauth include system-local-loginwithauth substack akari-gaze. - Uses a PAM substack so a
sufficientface match does not skip parent keyring hooks, while falling back to the standard password stack when face recognition fails or is unavailable.
Keyring unlocking with face login
Without TPM-backed password storage, a face login does not supply a password token to unlock GNOME Keyring or KWallet automatically. If you enable Gaze’s optional keyring integration, also run akari login configure-keyring --keyring gnome so the GNOME hook includes use_authtok.
To remove the Gaze PAM routing and restore password-only login:
akari login disable-gaze
Verify real login
When testing with the harness below, verify:
- Face match logs in without typing a password.
- Failed scan or covered camera falls back to password login.
- Switching accounts mid-scan cancels the prior attempt.
- A locked-out account remains denied even on a face match.
Install and run the harness
1. Build and install
Ensure no previous test or recovery timer is active, then build and install the harness:
# Install with the default theme
akari greetd-test install
# Or select another theme project
akari greetd-test install --theme themes/fallback
install compiles the theme and production backend in release mode (--jobs 4), backs up previous /opt/akari-test/ artifacts, and saves your active Sway or Hyprland monitor order to /opt/akari-test/display-layout.json.
2. Start from a TTY
-
Save your work and log out of your desktop session.
-
Switch to
tty3, log in, and start the test:akari greetd-test startOptional flags:
--scale NUMBER: Override the login output scale (default1).--log-dir /var/tmp/my-akari-test: Custom world-traversable log root.--dry-run: Print the execution plan without stopping the active display manager.
start arms recovery before stopping the active sddm.service display manager (note: the standalone greetd-test harness currently expects sddm.service as the active host display manager, whereas production akari install / akari login supports any systemd display-manager.service). Your prior sddm.service session is restored automatically when:
- Setup fails during preflight,
akari-test.serviceexits (ExecStopPost), or- The 10-minute fallback recovery timer fires.
3. Restore display manager manually
To end a test and return to your prior display manager from tty3:
akari greetd-test restore
# Emergency fallback if the repository or SDK is unavailable:
sudo /opt/akari-test/restore.sh
4. Check status and logs
Inspect service state, timers, and log paths without sudo:
akari greetd-test status
akari greetd-test status --format json
Logs are world-readable under /var/tmp/akari-greetd-test-<caller-uid>/ (e.g., /var/tmp/akari-greetd-test-1000/):
latest: Symlink to the newest startup attempt (including preflight failures).current: Symlink to the latest armed test run.current/greeter/session-*/: Containsbackend.log,flutter.log,sway.log,lifecycle.log,outputs.json, anddisplay-profile.json.
Query logs directly through the CLI:
# Latest start.log
akari greetd-test logs
# Last 100 lines of backend.log from the armed test
akari greetd-test logs --run current --file backend -n 100
# Follow flutter.log in real time
akari greetd-test logs --run current --file flutter --follow
Accepted --file values: start, backend, flutter, sway, lifecycle, screenshot, restore, and journal.
Capture the actual TTY login screen
With grim installed on the host, you can capture per-monitor screenshots directly from the live login screen without waking the dormant UI or closing open menus:
| Shortcut | Behavior |
|---|---|
Print | Immediately saves a PNG for each active output |
Shift+Print | Waits 3 seconds before capturing (useful for opening account/session menus) |
Screenshots and capture.json metadata are saved under greeter/session-*/screenshots/<timestamp>-*/ and remain readable after returning to your desktop:
akari greetd-test logs --run current --file screenshot
Back on your desktop, akari run sway automatically imports display-profile.json from the latest valid test so you can compare nested Sway with standalone login.
Offline harness tests
Validate harness scripts without root privileges or stopping your display manager:
python3 test/workflows/greetd_test_workflow_test.py
python3 test/workflows/greetd_screenshot_test.py
python3 test/workflows/display_profile_test.py
python3 test/workflows/display_layout_test.py
python3 test/workflows/sway_session_test.py