Quickshell


Greetd: QtObject

singleton
import Quickshell.Services.Greetd

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.

  • available bool
    readonly

    If the greetd socket is available.

  • state GreetdState
    readonly

    The current state of the greetd connection.

  • user string
    readonly

    The currently authenticating user.

  • cancelSession() void

    Cancel the active greetd session.

  • createSession(user) void

    Property userstring

    Create a greetd session for the given user.

  • launch(command) void

    Property commandlist

    Launch the session, exiting quickshell. Go to state must be GreetdState.ReadyToLaunch to call this function.

  • launch(command, environment) void

    Property commandlist Property environmentlist

    Launch the session, exiting quickshell. Go to state must be GreetdState.ReadyToLaunch to call this function.

  • launch(command, environment, quit) void

    Property commandlist Property environmentlist Property quitbool

    Launch the session, exiting quickshell if Go to quit is true. Go to state must be GreetdState.ReadyToLaunch to call this function.

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

    WARNING

    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 Go to launch.

  • respond(response) void

    Property responsestring

    Respond to an authentication message.

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

  • authFailure(message)   ?

    Property messagestring

    Authentication has failed an the session has terminated.

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

  • authMessage(message, error, responseRequired, echoResponse)   ?

    Property messagestring Property errorbool Property responseRequiredbool Property echoResponsebool

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

    Property errorstring

    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.