RAGS - v1.11.0
    Preparing search index...

    Greetd Service

    Service for communicating with the greetd login daemon over its Unix socket.

    Lifecycle:

    1. Ready - Send authentication requests via Unix socket
    2. Disposal - Cleanup resources (minimal - no persistent connections)

    Each method creates a new socket connection for the request and closes it after receiving the response.

    changed - Emitted when service state changes

    Hierarchy (View Summary)

    Implements

    Index

    Accessors

    • get isDisposed(): boolean

      Check if service has been disposed

      Returns boolean

    Constructors

    • Parameters

      • Optionalproperties: Partial<ConstructorProps>
      • ...args: any[]

      Returns Greetd

    Methods

    • Cancels the current greetd authentication session.

      Returns Promise<Response>

    • Notifies listeners that a property changed and emits the 'changed' signal.

      Parameters

      • property: string

        The property name that changed

      Returns void

    • Connects a callback to a signal on this service.

      Parameters

      • signal: string = 'changed'

        The signal name (defaults to 'changed')

      • callback: (_: this, ...args: any[]) => void

        The callback to invoke when the signal is emitted

      Returns number

      The signal connection ID

    • Creates a new greetd authentication session for the given user.

      Parameters

      • username: string

        The username to authenticate

      Returns Promise<Response>

      The greetd response (typically an auth_message prompt)

    • Creates an incremental list binding that reuses existing widgets.

      Instead of recreating all widgets on every update, this method caches widgets by a key function and only creates new widgets for new items, destroying widgets for removed items.

      Type Parameters

      • Item
      • Prop extends "isDisposed" | "$signals"

      Parameters

      • prop: Prop

        The property containing the item array

      • opts: {
            create: (item: Item) => Widget;
            key: (item: Item) => string | number;
            update?: (widget: Widget, item: Item) => void;
        }

        Key extractor, widget factory, and optional update callback

      Returns Binding<Greetd, Prop, Widget[]>

      A Binding that produces an array of widgets

      const children = audio.diffBind('speakers', {
      key: (s) => s.name,
      create: (s) => Widget.Label({ label: s.description }),
      update: (w, s) => { w.label = s.description; },
      });
    • Clean up all tracked signal connections Call this in service-specific dispose implementations

      Returns void

    • Emits a signal, warning if the signal was not registered via Service.register.

      The warning is cheap (a Set lookup per emit) and helps catch typos and missing signal declarations that silently break .bind().

      Parameters

      • signal: string
      • ...args: any[]

      Returns void

    • Performs a complete login flow: create session, authenticate, and start session.

      Parameters

      • username: string

        The user to log in as

      • password: string

        The authentication password

      • cmd: string | string[]

        Command to start (string is shell-parsed, array used directly)

      • env: string[] = []

        Optional environment variables for the session

      Returns Promise<void>

    • Responds to a greetd authentication challenge.

      Parameters

      • Optionalresponse: string

        The authentication response (e.g. password)

      Returns Promise<Response>

      The greetd response

    • Retry a DBus operation with exponential backoff

      Type Parameters

      • T

      Parameters

      • operation: () => Promise<T>
      • maxRetries: number = 3
      • baseDelay: number = 100

      Returns Promise<T>

    • Starts the authenticated session with the given command.

      Parameters

      • cmd: string | string[]

        Command to execute (string is shell-parsed)

      • env: string[] = []

        Optional environment variables

      Returns Promise<Response>

      The greetd response

    • Track a signal connection for automatic cleanup

      Parameters

      • emitter: Object

        The object the signal is connected to (defaults to this)

      • id: number

        The signal connection ID

      Returns void

    • Track a signal connection for automatic cleanup

      Parameters

      • id: number

        The signal connection ID

      Returns void

    • Updates a property value and emits a notify signal if the value changed.

      Performs a deep equality check via JSON serialization to avoid unnecessary notifications.

      Parameters

      • prop: string

        The property name in kebab-case

      • value: unknown

        The new value

      Returns void

    • Dynamically imports a built-in service by name.

      Type Parameters

      • S extends keyof Services

      Parameters

      • service: S

        The service name to import

      Returns Promise<Services[S]>

      The default export of the service module

      const Audio = await Service.import('audio');
      const Battery = await Service.import('battery');
    • Creates a GObject property specification.

      Parameters

      • name: string

        The property name in kebab-case

      • type: PspecType = 'jsobject'

        The property type (defaults to 'jsobject')

      • handle: PspecFlag = 'r'

        The access flag: 'r', 'w', or 'rw' (defaults to 'r')

      Returns ParamSpec<unknown>

      A GObject.ParamSpec

    • Registers a GObject subclass with signals and properties.

      Parameters

      • service: new (...args: any[]) => Object

        The class constructor to register

      • Optionalsignals: { [signal: string]: PspecType[] }

        Map of signal names to their parameter types

      • Optionalproperties: { [prop: string]: [type?: PspecType, handle?: PspecFlag] }

        Map of property names to [type, accessFlag] tuples

      Returns void