Greetd: QtObject [singleton]

import Quickshell.Services.Greetd

Properties

Functions

Signals

Detailed Description

This object provides access to a running greetd instance if present. With it you can authenticate a user and launch a session.

See the greetd wiki for instructions on how to set up a graphical greeter.

Property Details

[readonly]

available: bool

If the greetd socket is available.

[readonly]

state: GreetdState

The current state of the greetd connection.

[readonly]

user: string

The currently authenticating user.

Function Details

void cancelSession()

Cancel the active greetd session.

void createSession(user: string)

Create a greetd session for the given user.

void launch(command: list<string>)

Launch the session, exiting quickshell. readyToLaunch must be true to call this function.

void launch(command: list<string>, environment: list<string>)

Launch the session, exiting quickshell. readyToLaunch must be true to call this function.

void launch(command: list<string>, environment: list<string>, quit: bool)

Launch the session, exiting quickshell if quit is true. readyToLaunch must be true to call this function.

The launched signal can be used to perform an action after greetd has acknowledged the desired session.

⚠️

Note that greetd expects the greeter to terminate as soon as possible after setting a target session, and waiting too long may lead to unexpected behavior such as the greeter restarting.

Performing animations and such should be done before calling launch.

void respond(response: string)

Respond to an authentication message.

May only be called in response to an authMessage with responseRequired set to true.

Signal Details

authFailure(message: string)

Authentication has failed an the session has terminated.

Usually this is something like a timeout or a failed password entry.

authMessage(message: string, error: bool, responseRequired: bool, echoResponse: bool)

An authentication message has been sent by greetd.

  • message - the text of the message
  • error - if the message should be displayed as an error
  • responseRequired - if a response via respond() is required for this message
  • echoResponse - if the response should be displayed in clear text to the user

Note that error and responseRequired are mutually exclusive.

Errors are sent through authMessage when they are recoverable, such as a fingerprint scanner not being able to read a finger correctly, while definite failures such as a bad password are sent through authFailure.

error(error: string)

Greetd has encountered an error.

launched()

Greetd has acknowledged the launch request and the greeter should quit as soon as possible.

This signal is sent right before quickshell exits automatically if the launch was not specifically requested not to exit. You usually don’t need to use this signal.

readyToLaunch()

Authentication has finished successfully and greetd can now launch a session.