greeter

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

func LastUserPath(statePath string) string

LastUserPath is the last-user file beside the session state file.

func LoadLast

func LoadLast(path string) string

LoadLast reads a remembered value; "" when unset or unreadable.

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

func Run(init Init) error

Run shows the greeter until greetd starts a session (or the window closes): one fullscreen window on the kiosk compositor.

func RunApplyConfig

func RunApplyConfig(args []string, stdout, stderr io.Writer) int

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 SaveLast

func SaveLast(path, value string) error

SaveLast persists a remembered value, creating its directory.

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

type Cursor struct {
	Theme string // "" when unknown
	Size  uint32 // 0 when unknown
}

Cursor is what one source found; either side may be missing.

func DetectCursor

func DetectCursor(home, session string) Cursor

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

func ParseOptions(args []string) (Options, error)

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).

func LoadUsers

func LoadUsers() []User

LoadUsers reads the login users from /etc/passwd, avatars resolved.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL