# Eydos LoginManager

Modern Wayland login manager written in Rust for Eydos OS.

## Features

- **PAM Authentication** (with mock fallback for testing)
- **Wayland Session Launch** (Forge compositor)
- **Auto-login** support
- **Dark theme** UI with Eydos branding
- **Shutdown/Reboot** controls
- **Configurable** via TOML
- **Memory safe** (100% Rust)

## Building

```bash
cargo build --release            # whole workspace
cargo build --release -p loginmanager           # greeter only
cargo build --release -p loginmanager-daemon    # daemon only
```

Authentication in the greeter goes through greetd over the `GREETD_SOCK` Unix
socket. As a standalone-fallback (no `GREETD_SOCK` in env, i.e. development /
manual testing) the greeter authenticates directly against PAM via the `login`
service. To exercise the privileged path (PAM + VT switch + session spawn)
use the daemon — see the `daemon-*` targets in the Makefile.

## Configuration

Edit `/etc/eydos/loginmanager.toml`:

```toml
[autologin]
enabled = false
username = ""
delay_seconds = 0

[session]
default_command = "/usr/local/bin/forge-compositor"

[ui]
show_username_field = true
allow_shutdown = true
allow_reboot = true
```

## Installation

```bash
make
sudo make install
```

## Architecture

```
loginmanager/
├── Cargo.toml                 # Virtual workspace
├── crates/
│   ├── loginmanager/          # Greeter (Wayland GUI, runs as _greetd)
│   │   ├── Cargo.toml
│   │   ├── locales/           # rust-i18n translations
│   │   └── src/
│   │       ├── main.rs
│   │       ├── app/           # State / update / subscription / message
│   │       ├── login_screen.rs
│   │       ├── lock_screen.rs
│   │       ├── smartcast.rs
│   │       ├── smartcast_screen.rs
│   │       ├── splash_screen.rs
│   │       ├── osk.rs
│   │       ├── auth.rs
│   │       ├── greetd.rs
│   │       ├── forge.rs
│   │       ├── session.rs
│   │       └── config.rs
│   ├── loginmanager-daemon/   # Privileged daemon (PAM + VT, replaces greetd)
│   └── loginmanager-ipc/      # Protocol types shared by greeter ↔ daemon
├── data/
│   ├── greetd.toml            # greetd config (transitional, until daemon lands)
│   └── loginmanager-greeter   # Forge wrapper script for the greeter session
├── loginmanager.service       # Systemd unit
└── loginmanager.toml          # Config example
```

Wallpaper and lockscreen images come from the active ltk theme via
`ltk::theme_wallpaper()` / `ltk::theme_lockscreen()` (resolved through
`branding/{light,dark}/wallpaper.svg` and
`branding/{light,dark}/lockscreen.svg` in the theme tree), so
loginmanager doesn't ship its own backgrounds.

## Integration with Eydos

After successful login, launches:
- Forge Wayland compositor
- User shell/desktop session
- Proper Wayland environment variables

