Greetd: QtObject [singleton]
import Quickshell.Services.Greetd
Properties
Functions
- void cancelSession()
- void createSession(user: string)
- void launch(command: list<string>)
- void launch(command: list<string>, environment: list<string>)
- void launch(command: list<string>, environment: list<string>, quit: bool)
- void respond(response: string)
Signals
- authFailure(message: string)
- authMessage(message: string, error: bool, responseRequired: bool, echoResponse: bool)
- error(error: string)
- launched()
- readyToLaunch()
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
available: bool
If the greetd socket is available.
state: GreetdState
The current state of the greetd connection.
user: string
The currently authenticating user.
Function Details
void cancelSession()
Cancel the active greetd session.
Create a greetd session for the given user.
Launch the session, exiting quickshell.
readyToLaunch
must be true to call this function.
Launch the session, exiting quickshell.
readyToLaunch
must be true to call this function.
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
.
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.
An authentication message has been sent by greetd.
message
- the text of the messageerror
- if the message should be displayed as an errorresponseRequired
- if a response viarespond()
is required for this messageechoResponse
- 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.