Remove informational eprintln debug statements that were added during
development. Error messages in session.rs child process are retained
since tracing is not fork-safe and eprintln is the only way to report
errors from the forked child.
Wayland compositors like Hyprland use libseat to get device access
(DRM, input) through logind. This requires a properly registered
logind session, which pam_systemd creates during open_session().
The key insight is that PAM open_session() must be called in the
process that becomes the user session, not in the daemon. This commit
rewrites session launching to use manual fork/exec:
Child process (becomes user session):
1. Call setsid() to become session leader
2. Set XDG_SESSION_TYPE, XDG_VTNR, XDG_SEAT for pam_systemd
3. PAM authenticate() and open_session() - registers with logind
4. Drop privileges (initgroups, setgid, setuid)
5. Set up controlling TTY for Wayland (chown, TIOCSCTTY)
6. execve() the compositor
Parent process (daemon):
1. Wait for child with waitpid()
2. Handle session end, restart greeter
Other changes:
- Add resolve_command() to find executables in user PATH
- Use std::mem::forget() to prevent PAM client drop closing session
- Build environment variables as CStrings for execve()
Connect the authentication module to the session spawner by:
- Adding password field to SessionStartInfo (with redacted Debug impl)
- Passing password to UserSession::start() for both X11 and Wayland
- Improved error handling for Wayland session failures with X restart
- Add debug logging for session startup flow
Wayland compositors need proper logind session registration for device
access (DRM, input). This requires PAM open_session() to be called in
the process that will become the user session, not in the daemon.
Changes:
- Store password in Authenticated state for session spawner to use
- Rename pam_authenticate to pam_verify_only (no open_session)
- Export PAM_SERVICE_NAME constant for session module
- Update take_authenticated to return (username, password) tuple
The actual PAM open_session() call is now deferred to the forked
child process in the session module.
Session desktop files like Plasma's have multi-word Exec lines
(e.g., "/usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland").
Split the exec string into command and arguments so these sessions
can be launched correctly.
Add session_type parameter to handle_login function and include
it in the StartSession IPC request. Get session type from the
session selector for both button click and Enter key handlers.
Update UserSession::start signature to accept session_type and
optional display. Set XDG_SESSION_TYPE based on session type.
For Wayland sessions, set up controlling TTY via setsid/TIOCSCTTY.
Update daemon to pass session_type through SessionStartInfo and
branch on session type for X11 vs Wayland handling. For Wayland,
stop X server before launching compositor and restart afterward.
Enumerate sessions from /usr/share/wayland-sessions/ in addition
to X11 sessions. Each session is tagged with its type (x11/wayland)
for the daemon to handle appropriately.
Add power button tooltips that appear on hover. Implement
dynamic cursor changes: text cursor over input fields,
pointer cursor over clickable elements.
Auto-select first user on startup and skip to password field.
Add login button click handling.
Fix power icon vertical line direction. Clear Cairo path
state in avatar rendering to prevent path leaks between
draws.
Implement CursorType enum with Default, Text, and Pointer
variants using X11 cursor font glyphs. Add set_cursor()
method that only updates when cursor type changes.
Clear root window on startup to hide leftover content from
previous sessions (e.g., garbg wallpaper pixmaps).
Chunk put_image into 1MB segments to avoid exceeding X11
maximum request size on large displays.
Implement proper cursor movement with arrow keys, Home, End,
and Delete. Support shift+arrow for text selection with
visual highlight. Handle click-to-place cursor in text fields.
Fix caps lock interaction with shift key for correct case
handling on letter keys.
Add XAUTHORITY, XDG_SESSION_DESKTOP, XDG_CURRENT_DESKTOP,
XDG_DATA_DIRS, and XDG_CONFIG_DIRS to session environment.
Expand PATH to include ~/.local/bin and ~/.cargo/bin.
Remove Wayland session enumeration since gardm runs an X
server and Wayland compositors cannot run on X11.
Switch from pam-client to pam crate for simpler API. Use
PasswordConv for non-interactive authentication and add
debug logging throughout the auth flow.
Simplify PAM config to use pam_unix.so directly instead of
Fedora-specific includes and SELinux modules.
Add systemd-logind integration for power actions (shutdown, reboot,
suspend) via D-Bus. Update system configuration for Fedora compatibility.
Changes:
- Add zbus dependency for D-Bus communication
- Add power.rs module with logind integration
- Update PAM config based on SDDM's Fedora configuration
- Update systemd service for better compatibility
- Add deployment scripts:
- install.sh: installs binaries, configs, and service
- test-gardm.sh: safe testing on separate VT/display
- swap-dm.sh: safely swap from SDDM to gardm with rollback
Add theming system with customizable colors, fonts, and accessibility
options for the greeter UI.
Features:
- theme.rs with Color parsing (hex #RRGGBB, rgba(), rgb())
- Customizable colors: panel, text, accent, input, button
- Font family and size configuration
- High contrast mode with enhanced visibility
- Large text accessibility option (25% larger)
- Reduce motion option (disables fade transitions)
- All widgets updated to use theme values
Add monitor detection module using RandR to detect connected monitors,
their positions, and primary display. UI elements now center on the
primary monitor instead of the full virtual screen.
Changes:
- Add monitors.rs with MonitorConfig and Monitor structs
- Add randr feature to x11rb dependency
- Update LoginForm, UserList, PowerButtons to accept center coordinates
- Add root() accessor to GreeterWindow for RandR queries
- Add sprint documentation for sprints 5-8