Documentation
¶
Overview ¶
Package greeter is lys-greeter: a greetd greeter sharing the lock screen's credential prompt. It runs as the single client of a kiosk compositor (cage) that greetd spawns, drives the login over the greetd IPC socket, and exits when greetd starts the chosen session.
Index ¶
- func ApplyCursor(c Cursor)
- func CustomSessionName() string
- func LastUserPath(statePath string) string
- func LoadLast(path string) string
- func RecordCursor() error
- func Run(init Init) error
- func RunApplyConfig(args []string, stdout, stderr io.Writer) int
- func SaveLast(path, value string) error
- func SortSessions(sessions []Session)
- func Stylesheet(cfg *config.Config) *widget.Stylesheet
- type Cursor
- type Init
- type Options
- type Session
- type SessionKind
- type UsageError
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyCursor ¶
func ApplyCursor(c Cursor)
ApplyCursor exports the resolved cursor for lys-ui's theme loader.
func CustomSessionName ¶
func CustomSessionName() string
CustomSessionName labels the explicit `-- <argv>` session.
func LastUserPath ¶
LastUserPath is the last-user file beside the session state file.
func RecordCursor ¶
func RecordCursor() error
RecordCursor is the shell side (cursor_record.rs): from inside the live session, XCURSOR_THEME and XCURSOR_SIZE (falling back to HYPRCURSOR_SIZE) are the resolved truth, so they are written to $XDG_STATE_HOME/lys-shell/greeter-cursor for the next login screen. Nothing is written when neither is exported, so a good record is never clobbered by blanks.
func Run ¶
Run shows the greeter until greetd starts a session (or the window closes): one fullscreen window on the kiosk compositor.
func RunApplyConfig ¶
RunApplyConfig is `lys-greeter apply-config [--config PATH] <STAGED.yaml>`, run as root through pkexec by lys-settings: it copies only the allowlisted greeter keys of the staged file into runtime.yaml beside the system config, never touching config.yaml. It returns the exit code and writes its messages to stdout/stderr.
func SortSessions ¶
func SortSessions(sessions []Session)
SortSessions orders the merged list by lowercased name, as main.rs does after merging the kinds.
func Stylesheet ¶
func Stylesheet(cfg *config.Config) *widget.Stylesheet
Stylesheet is install_css: the compiled stylesheet and the configured palette's theme, at the bundle's priority, with lys-ui's theme installed from the same palette. The greeter carries no user styles: pre-login there is no user.
Types ¶
type Cursor ¶
Cursor is what one source found; either side may be missing.
func DetectCursor ¶
DetectCursor reads the cursor the user's session uses from dotfiles under home; session is the remembered session id, whose compositor is consulted first.
func ResolveCursor ¶
func ResolveCursor(g config.GreeterConfig, detected Cursor) Cursor
ResolveCursor applies install_cursor's order: an explicit greeter key (config.yaml or runtime.yaml), the detected dotfiles, the XCURSOR_* environment, then the size default. The theme may stay "".
type Init ¶
type Init struct {
Config *config.Config
// Sessions is non-empty (main enforces it).
Sessions []Session
Users []User
LastSession string
LastUser string
StatePath string
SessionEnv []string
}
Init is what the greeter starts from (app.rs GreeterInit).
type Options ¶
type Options struct {
// ConfigPath is the lys-shell config the greeter themes from.
ConfigPath string
// SessionDirs and XSessionDirs are scanned for session files.
SessionDirs, XSessionDirs []string
// StatePath remembers the last session id; the last username sits
// in a last-user file beside it.
StatePath string
// Command is the explicit fallback session from `-- <argv>`.
Command []string
// Env holds extra KEY=value entries for the session.
Env []string
}
Options are the parsed command line (config.rs Options).
func ParseOptions ¶
ParseOptions parses the arguments after the program name. Everything after "--" is the fallback session argv; the repeatable --sessions and --xsessions replace their defaults once given.
type Session ¶
type Session struct {
// ID is the .desktop stem, suffixed -x11 for X11 sessions; the
// remembered choice.
ID string
// Name is Name= (else the id), suffixed " (X11)" for X11.
Name string
// Exec is the argv from Exec=, field codes dropped (and the startx
// wrapper prepended for X11).
Exec []string
}
Session is one selectable session (session.rs Session).
func Discover ¶
func Discover(dirs []string, kind SessionKind) []Session
Discover reads kind sessions from every *.desktop under dirs: Hidden/NoDisplay entries and files without a usable Exec are skipped, and an id seen in an earlier dir wins (XDG precedence).
type SessionKind ¶
type SessionKind uint8
SessionKind is which discovery directory advertised a session.
const ( // Wayland sessions (wayland-sessions/*.desktop) start directly. Wayland SessionKind = iota // X11 sessions (xsessions/*.desktop) start through // `startx /usr/bin/env`: greetd runs no X server, startx provides // one (the tuigreet approach). X11 )
Session kinds.
type UsageError ¶
type UsageError struct {
// contains filtered or unexported fields
}
UsageError is a malformed command line; the greeter exits 2 with it.
func (UsageError) Error ¶
func (e UsageError) Error() string
type User ¶
type User struct {
// Name is the login name greetd authenticates.
Name string
// DisplayName is the GECOS full name, else Name.
DisplayName string
// Home seeds ~/.face and cursor detection (it may be unreadable).
Home string
// Icon is a readable avatar path, "" when none.
Icon string
}
User is one login account offered in the user list (users.rs).