- split dependencies into core shell, wallpaper, workspaces, system services and optional greeter groups - add a Greeter section covering architecture, install, systemd reload and preview commands - link the greeter screenshot and fix the duplicated screenshot caption - give the standalone greeter its own AGS instance name so previewing it no longer collides with the running bar
4.6 KiB
AGS greeter for greetd
A small AGS (GTK4) login UI that reuses this shell's pywal theme, wired to greetd through AstalGreet.
How it fits together
greetd ──exec──> start-greeter.sh ──> cage ──> dbus-run-session ──> ags run greeter.tsx
^ │
└──────────────── AstalGreet.Greeter (GREETD_SOCK) <─────────────────────┘
AstalGreet is only the greetd IPC client; a compositor still has to host the
GTK window. Cage is used because it is a tiny kiosk compositor. Cage does not
support wlr-layer-shell, so the greeter is a plain Gtk.ApplicationWindow
(which cage maximizes) instead of an Astal.Window.
Requirements
greetd(already installed)libastal-meta(includes AstalGreet) orlibastal-greetdags(already installed)cage—pacman -S cageuwsm,polkitanddbus—pacman -S uwsm polkit dbusdart-sass(already installed, used to compile the theme)- a
greeteruser in thevideogroup (already present)
Install
sudo pacman -S cage uwsm polkit dbus
sudo ./greeter/install.sh
The script:
- copies
greeter.tsx,style.scss, andstart-greeter.shto/etc/greetd/ags(thegreeteruser cannot read/home/pascal, which is0700) - creates
/var/lib/greetd/{run,.cache}owned bygreeter - compiles a fallback theme and seeds the current pywal theme/wallpaper
- installs
/etc/polkit-1/rules.d/49-greetd-greeter.rulesso thegreeteruser can reboot/power off from the login screen - writes
/etc/greetd/config.toml(backup atconfig.toml.bak)
Keep a TTY available (Ctrl+Alt+F2) before restarting greetd so you can recover if the greeter fails.
sudo systemctl restart greetd
Theming
theme.ts now calls exportGreeterTheme() on startup and after every
setTheme():
greeter/style.scssis compiled with the currentwalpalette to/var/tmp/ags-greeter/greeter.css~/.cache/current_wallpaper.jpgis copied to/var/tmp/ags-greeter/wallpaper.jpg
/var/tmp is used because it survives reboots and is readable by the
greeter user. /tmp is empty at boot (the greeter runs before login) and
~/.cache/wal is unreadable by greeter.
If the exported files do not exist yet, the greeter uses
/etc/greetd/ags/fallback.css, then an inline fallback.
Preview
In a running Hyprland session, next to the bar (the greeter uses the distinct
greeter instance name):
ags run ./greeter/greeter.tsx
This shows the real UI, but pressing "Log in" reports that the greeter must be
started by greetd (there is no GREETD_SOCK in your session).
For a full kiosk-style preview, and for screenshots, run it inside a nested cage window:
cage -d -- dbus-run-session -- ags run ./greeter/greeter.tsx
Close the preview with your Hyprland close-window keybind or:
ags quit -i greeter
Login messages and power buttons
PAM info/error messages are shown in the card. greetd often reports only a
result code (for example authenticate: AUTH_ERR), so the greeter maps those
to readable text such as "Incorrect password. Please try again."
The card also has reboot and shut-down buttons. They call
/usr/bin/systemctl; the polkit rule installed by install.sh allows the
greeter user to perform those two actions without an authentication agent.
Debugging
greetd prefixes its command with exec, so the chain lives in
start-greeter.sh. Its output (cage/AGS) is logged to:
cat /tmp/greeter.log
If greetd hits start-limit-hit, reset it after fixing:
sudo systemctl reset-failed greetd
sudo systemctl start greetd
Notes / limitations
cage -m last(instart-greeter.sh) puts the greeter on one monitor only. Use-m extendto span all monitors, or switch to a layer-shell compositor (sway/Hyprland) if you want per-monitor greeter windows.- After a successful login the greeter starts
/usr/bin/uwsm start -e -D Hyprland hyprland.desktop(the same command as/usr/share/wayland-sessions/hyprland-uwsm.desktop). No greetd-specific uwsm configuration is needed;~/.config/uwsm/env*is still read from your home when uwsm starts the user session. If you stop using uwsm, replaceSESSION_CMDingreeter.tsxwith["/usr/bin/start-hyprland"]. - The username field defaults to the user recorded in
/etc/greetd/ags/default-user; it can be edited before logging in. - The reboot and shutdown buttons act immediately, without a confirmation step.