LightDM.Greeter¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The user being authenticated |
||
r |
Autologin guest account hint |
||
r |
Autologin session hint |
||
r |
Autologin timeout hint |
||
r |
Autologin user hint |
||
r |
Default session hint |
||
r |
Has guest account hint |
||
r |
Hide users hint |
||
r |
|
||
r |
|
||
r |
Lock hint |
||
r |
Select guest account hint |
||
r |
Select user hint |
||
r |
Show manual login hint |
||
r |
Show remote login hint |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class LightDM.Greeter(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
LightDM.Greeter
is an opaque data structure and can only be accessed using the provided functions.- classmethod new()¶
- Returns:
the new
LightDM.Greeter
- Return type:
Create a new greeter.
- authenticate(username)¶
- Parameters:
username (
str
orNone
) – A username orNone
to prompt for a username.- Raises:
- Returns:
True
if authentication request sent.- Return type:
Starts the authentication procedure for a user.
- authenticate_as_guest()¶
- Raises:
- Returns:
True
if authentication request sent.- Return type:
Starts the authentication procedure for the guest user.
- authenticate_autologin()¶
- Raises:
- Returns:
True
if authentication request sent.- Return type:
Starts the authentication procedure for the automatic login user.
- authenticate_remote(session, username)¶
- Parameters:
- Raises:
- Returns:
True
if authentication request sent.- Return type:
Start authentication for a remote session type.
- cancel_authentication()¶
- Raises:
- Returns:
True
if cancel request sent.- Return type:
Cancel the current user authentication.
- cancel_autologin()¶
Cancel the automatic login.
- connect_sync()¶
- Raises:
- Returns:
True
if successfully connected- Return type:
Connects the greeter to the display manager. Will block until connected.
Deprecated since version 1.11.1: Use
LightDM.Greeter.connect_to_daemon_sync
() instead
- connect_to_daemon(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when completed orNone
.user_data (
object
orNone
) – data to pass to the callback orNone
.
Asynchronously connects the greeter to the display manager.
When the operation is finished, callback will be invoked. You can then call
LightDM.Greeter.connect_to_daemon_finish
() to get the result of the operation.See
LightDM.Greeter.connect_to_daemon_sync
() for the synchronous version.
- connect_to_daemon_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
True
if successfully connected- Return type:
Finishes an operation started with
LightDM.Greeter.connect_to_daemon
().
- connect_to_daemon_sync()¶
- Raises:
- Returns:
True
if successfully connected- Return type:
Connects the greeter to the display manager. Will block until connected.
- Parameters:
username (
str
) – A usernamecancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when completed orNone
.user_data (
object
orNone
) – data to pass to the callback orNone
.
Ensure that a shared data dir for the given user is available. Both the greeter user and username will have write access to that folder. The intention is that larger pieces of shared data would be stored there (files that the greeter creates but wants to give to a user – like camera photos – or files that the user creates but wants the greeter to see – like contact avatars).
LightDM will automatically create these if the user actually logs in, so greeters only need to call this method if they want to store something in the directory themselves.
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
The path to the shared directory, free with
GLib.free
.- Return type:
Function to call from
LightDM.Greeter.ensure_shared_data_dir
callback.
- Parameters:
username (
str
) – A username- Raises:
- Returns:
The path to the shared directory, free with
GLib.free
.- Return type:
Ensure that a shared data dir for the given user is available. Both the greeter user and username will have write access to that folder. The intention is that larger pieces of shared data would be stored there (files that the greeter creates but wants to give to a user – like camera photos – or files that the user creates but wants the greeter to see – like contact avatars).
LightDM will automatically create these if the user actually logs in, so greeters only need to call this method if they want to store something in the directory themselves.
- get_authentication_user()¶
- Returns:
The username of the authentication user being authenticated or
None
if no authentication in progress.- Return type:
Get the user that is being authenticated.
- get_autologin_guest_hint()¶
-
Check if the guest account should be automatically logged into when the timer expires.
- get_autologin_session_hint()¶
-
Get the session used to automatically log into when the timer expires.
- get_autologin_timeout_hint()¶
- Returns:
The number of seconds to wait before automatically logging in or 0 for no timeout.
- Return type:
Get the number of seconds to wait before automatically logging in.
- get_autologin_user_hint()¶
- Returns:
The user account to automatically log into or
None
if none configured.- Return type:
Get the user account to automatically log into when the timer expires.
- get_default_session_hint()¶
- Returns:
The session name
- Return type:
Get the default session to use.
- get_has_guest_account_hint()¶
-
Check if guest sessions are supported.
- get_hide_users_hint()¶
-
Check if user accounts should be shown. If this is
True
then the list of accounts should be taken fromLightDM.UserList
and displayed in the greeter for the user to choose from. Note that this list can be empty and it is recommended you show a method for the user to enter a username manually.If this option is shown the greeter should only allow these users to be chosen for login unless the manual login hint is set.
- get_hint(name)¶
- Parameters:
name (
str
) – The hint name to query.- Returns:
The value for this hint or
None
if not set.- Return type:
Get a hint.
- get_in_authentication()¶
-
Checks if the greeter is in the process of authenticating.
- get_is_authenticated()¶
-
Checks if the greeter has successfully authenticated.
- get_lock_hint()¶
-
Check if the greeter is acting as a lock screen.
- get_select_guest_hint()¶
-
Check if the guest account should be selected by default.
- get_select_user_hint()¶
-
Get the user to select by default.
- get_show_manual_login_hint()¶
-
Check if a manual login option should be shown. If set the GUI should provide a way for a username to be entered manually. Without this hint a greeter which is showing a user list can limit logins to only those users.
- get_show_remote_login_hint()¶
-
Check if a remote login option should be shown. If set the GUI should provide a way for a user to log into a remote desktop server.
- respond(response)¶
- Parameters:
response (
str
) – Response to a prompt- Raises:
- Returns:
True
if response sent.- Return type:
Provide response to a prompt. May be one in a series.
- set_language(language)¶
- Parameters:
language (
str
) – The language to use for this user in the form of a locale specification (e.g. “de_DE.UTF-8”).- Raises:
- Returns:
True
if set language request sent.- Return type:
Set the language for the currently authenticated user.
- set_resettable(resettable)¶
- Parameters:
resettable (
bool
) – Whether the greeter wants to be reset instead of killed after the user logs in
Set whether the greeter will be reset instead of killed after the user logs in. This must be called before lightdm_greeter_connect is called.
- start_session(session, cancellable, callback, *user_data)¶
- Parameters:
session (
str
orNone
) – The session to log into orNone
to use the default.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when completed orNone
.user_data (
object
orNone
) – data to pass to the callback orNone
.
Asynchronously start a session for the authenticated user.
When the operation is finished, callback will be invoked. You can then call
LightDM.Greeter.start_session_finish
() to get the result of the operation.See
LightDM.Greeter.start_session_sync
() for the synchronous version.
- start_session_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
True
if the session was started.- Return type:
Start a session for the authenticated user.
- start_session_sync(session)¶
- Parameters:
session (
str
orNone
) – The session to log into orNone
to use the default.- Raises:
- Returns:
True
if the session was started.- Return type:
Start a session for the authenticated user.
- do_authentication_complete() virtual¶
- do_autologin_timer_expired() virtual¶
- do_idle() virtual¶
- do_reset() virtual¶
- do_show_message(text, type) virtual¶
- Parameters:
text (
str
) –type (
LightDM.MessageType
) –
- do_show_prompt(text, type) virtual¶
- Parameters:
text (
str
) –type (
LightDM.PromptType
) –
Signal Details¶
- LightDM.Greeter.signals.authentication_complete(greeter)¶
- Signal Name:
authentication-complete
- Flags:
- Parameters:
greeter (
LightDM.Greeter
) – The object which received the signal
The
::authentication-complete
signal gets emitted when the greeter has completed authentication.Call
LightDM.Greeter.get_is_authenticated
() to check if the authentication was successful.
- LightDM.Greeter.signals.autologin_timer_expired(greeter)¶
- Signal Name:
autologin-timer-expired
- Flags:
- Parameters:
greeter (
LightDM.Greeter
) – The object which received the signal
The
::timed-login
signal gets emitted when the automatic login timer has expired. The application should then callLightDM.Greeter.authenticate_autologin
().
- LightDM.Greeter.signals.idle(greeter)¶
- Signal Name:
idle
- Flags:
- Parameters:
greeter (
LightDM.Greeter
) – The object which received the signal
The
::idle
signal gets emitted when the user has logged in and the greeter is no longer needed.This signal only matters if the greeter has marked itself as resettable using
LightDM.Greeter.set_resettable
().
- LightDM.Greeter.signals.reset(greeter)¶
- Signal Name:
reset
- Flags:
- Parameters:
greeter (
LightDM.Greeter
) – The object which received the signal
The
::reset
signal gets emitted when the user is returning to a greeter that was previously marked idle.This signal only matters if the greeter has marked itself as resettable using
LightDM.Greeter.set_resettable
().
- LightDM.Greeter.signals.show_message(greeter, text, type)¶
- Signal Name:
show-message
- Flags:
- Parameters:
greeter (
LightDM.Greeter
) – The object which received the signaltext (
str
) – Message texttype (
LightDM.MessageType
) – Message type
The
::show-message
signal gets emitted when the greeter should show a message to the user.
- LightDM.Greeter.signals.show_prompt(greeter, text, type)¶
- Signal Name:
show-prompt
- Flags:
- Parameters:
greeter (
LightDM.Greeter
) – The object which received the signaltext (
str
) – Prompt texttype (
LightDM.PromptType
) – Prompt type
The
::show-prompt
signal gets emitted when the greeter should show a prompt to the user. The given text should be displayed and an input field for the user to provide a response.Call
LightDM.Greeter.respond
() with the resultant input orLightDM.Greeter.cancel_authentication
() to abort the authentication.
Property Details¶
- LightDM.Greeter.props.authentication_user¶
-
The user being authenticated
- LightDM.Greeter.props.autologin_guest_hint¶
-
Autologin guest account hint
- LightDM.Greeter.props.autologin_session_hint¶
-
Autologin session hint
- LightDM.Greeter.props.autologin_timeout_hint¶
-
Autologin timeout hint
- LightDM.Greeter.props.autologin_user_hint¶
-
Autologin user hint
- LightDM.Greeter.props.default_session_hint¶
-
Default session hint
- LightDM.Greeter.props.has_guest_account_hint¶
-
Has guest account hint
- LightDM.Greeter.props.hide_users_hint¶
-
Hide users hint
- LightDM.Greeter.props.lock_hint¶
-
Lock hint
- LightDM.Greeter.props.select_guest_hint¶
-
Select guest account hint
- LightDM.Greeter.props.select_user_hint¶
-
Select user hint
- LightDM.Greeter.props.show_manual_login_hint¶
-
Show manual login hint