nevaforget 14d6476e5a fix: audit findings — wallpaper safety, log filtering, error truncation (v0.4.1)
- Rework load_background_texture(): use resources_lookup_data()/from_bytes()
  for GResource path (no abort on missing resource), add 50 MB file size limit,
  handle non-UTF-8 paths gracefully
- Filter error details to debug level only — warn! logs without internal details
  to prevent system info leaking into journal
- Make debug logging opt-in via MOONGREET_DEBUG env var (default: Info)
- Truncate greetd error description in stale-session retry path using
  MAX_GREETD_ERROR_LENGTH (matching show_greetd_error())
- Add 3 unit tests for load_background_texture edge cases
2026-03-28 10:29:21 +01:00

Moongreet

A greetd greeter for Wayland, built with Rust + GTK4 + gtk4-layer-shell. Part of the Moonarch ecosystem.

Features

  • greetd IPC — Communicates via $GREETD_SOCK (length-prefixed JSON)
  • User list — Parsed from /etc/passwd (UID 100065533)
  • Avatars — AccountsService icons, ~/.face fallback, default SVG with theme tinting
  • Sessions — Discovered from /usr/share/wayland-sessions/ and /usr/share/xsessions/
  • Last user/session — Remembered in /var/cache/moongreet/
  • Power actions — Reboot / Shutdown via loginctl
  • Layer Shell — Fullscreen via gtk4-layer-shell (TOP layer)
  • Multi-monitor — Greeter on primary, wallpaper on all monitors
  • i18n — German and English (auto-detected from system locale)
  • Faillock warning — Warns after 2 failed attempts, locked message after 3

Requirements

  • GTK 4
  • gtk4-layer-shell (for Wayland fullscreen)
  • greetd

Building

cargo build --release

Installation

# Install binary
sudo install -Dm755 target/release/moongreet /usr/bin/moongreet

# Install config
sudo mkdir -p /etc/moongreet
sudo cp config/moongreet.toml /etc/moongreet/moongreet.toml

System Setup

  1. Edit /etc/moongreet/moongreet.toml — set an absolute path for the wallpaper.

  2. Create cache directory:

    sudo mkdir -p /var/cache/moongreet/last-session
    sudo chown greeter:greeter /var/cache/moongreet
    
  3. Configure greetd (/etc/greetd/config.toml):

    [default_session]
    command = "niri -c /etc/greetd/niri-greeter.kdl"
    user = "greeter"
    

Development

# Run tests
cargo test

# Build release
cargo build --release

# Run locally (without greetd, needs LD_PRELOAD for layer-shell)
LD_PRELOAD=/usr/lib/libgtk4-layer-shell.so ./target/release/moongreet

License

MIT

Description
No description provided
Readme 5.9 MiB
Languages
Rust 97.8%
CSS 1.4%
Shell 0.8%