login greeter
git clone https://git.lucas.co/cce-display-manager.git
README.md (3.9K)
1 # CCE Display Manager
2
3 `cce-display-manager` is a premium GUI display manager greeter built using the `cce-ui` framework, leveraging Wayland via `smithay-client-toolkit` and GPU-accelerated graphics via `wgpu`.
4
5 It integrates seamlessly with the rest of the **Clear OS** desktop ecosystem, offering a highly customized login greeter interface that transitions directly into the `clear-computing-environment-client` (River WM) or standard fallback sessions.
6
7 ## Features
8
9 - **Premium Design Aesthetics**: Fully hardware-accelerated dark theme matching the design system of the Clear desktop environment.
10 - **Session Selector**: Interactive session cyclist allowing selection between the Wayland-based River window manager and a fallback Bash login shell.
11 - **Obfuscated Password Fields**: Dedicated custom password widget wrapper around `cce-ui` text inputs.
12 - **Focus Cycle Navigation**: Easily navigate fields using standard `Tab` focus switching keys.
13 - **Seamless Launch Integration**: Authenticates credentials and starts the session via `/home/lsgalante/Dropbox/Clear/clear-computing-environment-client/start-river.sh`.
14
15 ## Architecture
16
17 - **Wayland Protocol Handling**: Managed using `smithay-client-toolkit` and `calloop` event dispatcher loop.
18 - **Rendering Engine**: `wgpu` with WGSL custom shaders and `glyphon` text atlas system.
19 - **Core GUI**: Designed as a layout grid inside a centered card frame containing:
20 - Custom `LoginCard` container box
21 - `TextBox` input fields
22 - Cyclic `Button` session selector
23 - `StatusLabel` validation indicator
24
25 ## Running & Compiling
26
27 Build the project locally:
28
29 ```bash
30 cargo build --release
31 ```
32
33 Run in an existing Wayland environment (for testing/development):
34
35 ```bash
36 cargo run
37 ```
38
39 ## Login keyring
40
41 Login here is by fingerprint, so PAM never sees a password and
42 `pam_gnome_keyring` cannot unlock anything. The keyring password is instead
43 sealed to the machine's TPM and fed to the daemon at startup.
44
45 - `scripts/cce-gnome-keyring-enroll` — one-time: seals a random password with
46 **tpm2-tools** into `~/.config/cce/keyring-seal.{pub,priv}` and creates the
47 gnome-keyring `login` keyring with it. Needs the `tss` group and
48 `tpm2-tools`.
49 - `scripts/cce-gnome-keyring-start` — unseals and pipes the password into
50 `gnome-keyring-daemon --foreground --unlock`, as a single process.
51 - `systemd/gnome-keyring-daemon.service.d/tpm-unlock.conf` — points the stock
52 unit at that script and sets `Restart=no`.
53 - `dbus/org.freedesktop.secrets.service` — routes bus activation to the same
54 unit, so there is only ever one provider.
55
56 **`ccebuild` does not install drop-ins** — `unit_files()` matches only
57 `.service/.target/.timer/.socket/.path`. Install this one by hand:
58
59 ```bash
60 install -Dm644 systemd/gnome-keyring-daemon.service.d/tpm-unlock.conf \
61 ~/.config/systemd/user/gnome-keyring-daemon.service.d/tpm-unlock.conf
62 ```
63
64 Three traps, each of which broke a previous attempt:
65
66 - **`systemd-creds` is not usable here.** Run by a non-root user it does not
67 touch the TPM; it delegates to a polkit-gated root service. It succeeds in an
68 interactive session and fails at login with
69 `io.systemd.InteractiveAuthenticationRequired`. tpm2-tools talks to
70 `/dev/tpmrm0` directly via the `tss` group, so it needs no agent.
71 - **Never validate this from an interactive shell** — it has a polkit agent and
72 a TTY that the login path does not. Use
73 `systemd-run --user --pipe --wait --setenv=PATH=...`, which reproduces the
74 login environment and the failure above.
75 - **`Restart=no` is load-bearing.** A drop-in replacing `ExecStart` inherits the
76 stock `Restart=on-failure`; with a credential that could not decrypt at login
77 that produced 99 restarts in ~90s and hung the greeter. Losing secrets is
78 recoverable, an unusable login is not.
79
80 Clients need `--password-store=gnome-libsecret`: Chromium picks its backend
81 from `XDG_CURRENT_DESKTOP`, does not recognise `cce`, and silently falls back
82 to plaintext even when the keyring is healthy.