LightDM.Greeter

g GObject.Object GObject.Object LightDM.Greeter LightDM.Greeter GObject.Object->LightDM.Greeter

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

authenticate (username)

authenticate_as_guest ()

authenticate_autologin ()

authenticate_remote (session, username)

cancel_authentication ()

cancel_autologin ()

connect_sync ()

connect_to_daemon (cancellable, callback, *user_data)

connect_to_daemon_finish (result)

connect_to_daemon_sync ()

ensure_shared_data_dir (username, cancellable, callback, *user_data)

ensure_shared_data_dir_finish (result)

ensure_shared_data_dir_sync (username)

get_authentication_user ()

get_autologin_guest_hint ()

get_autologin_session_hint ()

get_autologin_timeout_hint ()

get_autologin_user_hint ()

get_default_session_hint ()

get_has_guest_account_hint ()

get_hide_users_hint ()

get_hint (name)

get_in_authentication ()

get_is_authenticated ()

get_lock_hint ()

get_select_guest_hint ()

get_select_user_hint ()

get_show_manual_login_hint ()

get_show_remote_login_hint ()

respond (response)

set_language (language)

set_resettable (resettable)

start_session (session, cancellable, callback, *user_data)

start_session_finish (result)

start_session_sync (session)

Virtual Methods

Inherited:

GObject.Object (7)

do_authentication_complete ()

do_autologin_timer_expired ()

do_idle ()

do_reset ()

do_show_message (text, type)

do_show_prompt (text, type)

Properties

Name

Type

Flags

Short Description

authentication-user

str

r

The user being authenticated

autologin-guest-hint

bool

r

Autologin guest account hint

autologin-session-hint

str

r

Autologin session hint

autologin-timeout-hint

int

r

Autologin timeout hint

autologin-user-hint

str

r

Autologin user hint

default-session-hint

str

r

Default session hint

has-guest-account-hint

bool

r

Has guest account hint

hide-users-hint

bool

r

Hide users hint

in-authentication

bool

r

True if a user is being authenticated

is-authenticated

bool

r

True if the selected user is authenticated

lock-hint

bool

r

Lock hint

select-guest-hint

bool

r

Select guest account hint

select-user-hint

str

r

Select user hint

show-manual-login-hint

bool

r

Show manual login hint

show-remote-login-hint

bool

r

Show remote login hint

Signals

Inherited:

GObject.Object (1)

Name

Short Description

authentication-complete

The ::authentication-complete signal gets emitted when the greeter has completed authentication.

autologin-timer-expired

The ::timed-login signal gets emitted when the automatic login timer has expired.

idle

The ::idle signal gets emitted when the user has logged in and the greeter is no longer needed.

reset

The ::reset signal gets emitted when the user is returning to a greeter that was previously marked idle.

show-message

The ::show-message signal gets emitted when the greeter should show a message to the user.

show-prompt

The ::show-prompt signal gets emitted when the greeter should show a prompt to the user.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class LightDM.Greeter(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

LightDM.GreeterClass

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:

LightDM.Greeter

Create a new greeter.

authenticate(username)
Parameters:

username (str or None) – A username or None to prompt for a username.

Raises:

GLib.Error

Returns:

True if authentication request sent.

Return type:

bool

Starts the authentication procedure for a user.

authenticate_as_guest()
Raises:

GLib.Error

Returns:

True if authentication request sent.

Return type:

bool

Starts the authentication procedure for the guest user.

authenticate_autologin()
Raises:

GLib.Error

Returns:

True if authentication request sent.

Return type:

bool

Starts the authentication procedure for the automatic login user.

authenticate_remote(session, username)
Parameters:
  • session (str) – The name of a remote session

  • username (str or None) – A username of None to prompt for a username.

Raises:

GLib.Error

Returns:

True if authentication request sent.

Return type:

bool

Start authentication for a remote session type.

cancel_authentication()
Raises:

GLib.Error

Returns:

True if cancel request sent.

Return type:

bool

Cancel the current user authentication.

cancel_autologin()

Cancel the automatic login.

connect_sync()
Raises:

GLib.Error

Returns:

True if successfully connected

Return type:

bool

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:

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) – A Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True if successfully connected

Return type:

bool

Finishes an operation started with LightDM.Greeter.connect_to_daemon().

connect_to_daemon_sync()
Raises:

GLib.Error

Returns:

True if successfully connected

Return type:

bool

Connects the greeter to the display manager. Will block until connected.

ensure_shared_data_dir(username, cancellable, callback, *user_data)
Parameters:

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.

ensure_shared_data_dir_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult.

Raises:

GLib.Error

Returns:

The path to the shared directory, free with GLib.free.

Return type:

str

Function to call from LightDM.Greeter.ensure_shared_data_dir callback.

ensure_shared_data_dir_sync(username)
Parameters:

username (str) – A username

Raises:

GLib.Error

Returns:

The path to the shared directory, free with GLib.free.

Return type:

str

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:

str or None

Get the user that is being authenticated.

get_autologin_guest_hint()
Returns:

True if the guest account should be automatically logged into.

Return type:

bool

Check if the guest account should be automatically logged into when the timer expires.

get_autologin_session_hint()
Returns:

The session name or None if configured to use the default.

Return type:

str or None

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:

int

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:

str or None

Get the user account to automatically log into when the timer expires.

get_default_session_hint()
Returns:

The session name

Return type:

str

Get the default session to use.

get_has_guest_account_hint()
Returns:

True if guest sessions are supported.

Return type:

bool

Check if guest sessions are supported.

get_hide_users_hint()
Returns:

True if the available users should not be shown.

Return type:

bool

Check if user accounts should be shown. If this is True then the list of accounts should be taken from LightDM.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:

str or None

Get a hint.

get_in_authentication()
Returns:

True if the greeter is authenticating a user.

Return type:

bool

Checks if the greeter is in the process of authenticating.

get_is_authenticated()
Returns:

True if the greeter is authenticated for login.

Return type:

bool

Checks if the greeter has successfully authenticated.

get_lock_hint()
Returns:

True if the greeter was triggered by locking the seat.

Return type:

bool

Check if the greeter is acting as a lock screen.

get_select_guest_hint()
Returns:

True if the guest account should be selected by default.

Return type:

bool

Check if the guest account should be selected by default.

get_select_user_hint()
Returns:

A username or None if no particular user should be selected.

Return type:

str or None

Get the user to select by default.

get_show_manual_login_hint()
Returns:

True if a manual login option should be shown.

Return type:

bool

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()
Returns:

True if a remote login option should be shown.

Return type:

bool

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:

GLib.Error

Returns:

True if response sent.

Return type:

bool

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:

GLib.Error

Returns:

True if set language request sent.

Return type:

bool

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:

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) – A Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True if the session was started.

Return type:

bool

Start a session for the authenticated user.

start_session_sync(session)
Parameters:

session (str or None) – The session to log into or None to use the default.

Raises:

GLib.Error

Returns:

True if the session was started.

Return type:

bool

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:
do_show_prompt(text, type) virtual
Parameters:

Signal Details

LightDM.Greeter.signals.authentication_complete(greeter)
Signal Name:

authentication-complete

Flags:

RUN_LAST

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:

RUN_LAST

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 call LightDM.Greeter.authenticate_autologin().

LightDM.Greeter.signals.idle(greeter)
Signal Name:

idle

Flags:

RUN_LAST

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:

RUN_LAST

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:

RUN_LAST

Parameters:

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:

RUN_LAST

Parameters:

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 or LightDM.Greeter.cancel_authentication() to abort the authentication.

Property Details

LightDM.Greeter.props.authentication_user
Name:

authentication-user

Type:

str

Default Value:

None

Flags:

READABLE

The user being authenticated

LightDM.Greeter.props.autologin_guest_hint
Name:

autologin-guest-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Autologin guest account hint

LightDM.Greeter.props.autologin_session_hint
Name:

autologin-session-hint

Type:

str

Default Value:

None

Flags:

READABLE

Autologin session hint

LightDM.Greeter.props.autologin_timeout_hint
Name:

autologin-timeout-hint

Type:

int

Default Value:

0

Flags:

READABLE

Autologin timeout hint

LightDM.Greeter.props.autologin_user_hint
Name:

autologin-user-hint

Type:

str

Default Value:

None

Flags:

READABLE

Autologin user hint

LightDM.Greeter.props.default_session_hint
Name:

default-session-hint

Type:

str

Default Value:

None

Flags:

READABLE

Default session hint

LightDM.Greeter.props.has_guest_account_hint
Name:

has-guest-account-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Has guest account hint

LightDM.Greeter.props.hide_users_hint
Name:

hide-users-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Hide users hint

LightDM.Greeter.props.in_authentication
Name:

in-authentication

Type:

bool

Default Value:

False

Flags:

READABLE

True if a user is being authenticated

LightDM.Greeter.props.is_authenticated
Name:

is-authenticated

Type:

bool

Default Value:

False

Flags:

READABLE

True if the selected user is authenticated

LightDM.Greeter.props.lock_hint
Name:

lock-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Lock hint

LightDM.Greeter.props.select_guest_hint
Name:

select-guest-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Select guest account hint

LightDM.Greeter.props.select_user_hint
Name:

select-user-hint

Type:

str

Default Value:

None

Flags:

READABLE

Select user hint

LightDM.Greeter.props.show_manual_login_hint
Name:

show-manual-login-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Show manual login hint

LightDM.Greeter.props.show_remote_login_hint
Name:

show-remote-login-hint

Type:

bool

Default Value:

False

Flags:

READABLE

Show remote login hint