Table of Contents
Table of Contents
Table of Contents
ConsoleKit2 is a framework for keeping track of the various users, sessions, and seats present on a system. It provides a mechanism for software to react to changes of any of these items or of any of the metadata associated with them. ConsoleKit2 also allows fast switching between open sessions on the computer.
ConsoleKit2 is a fork of ConsoleKit since it is no longer maintained. Information on ConsoleKit can be found at: http://freedesktop.org/wiki/Software/ConsoleKit/ William Jon McCann was the primary maintainer of ConsoleKit and most of this documentation was written by him for ConsoleKit. It has been adapted for ConsoleKit2.
A simple example is two users logging into a computer at the same time. They may be sharing the same set of hardware for their graphical session, such as the monitor, keyboard, and mouse. ConsoleKit2 will keep track of those resouces and which session is active and should have use of that hardware at a given time.
Table of Contents
A session is a collection of all processes that share knowledge of a secret. In the typical (or ideal) case, these processes all originate from a single common ancestor.
As an implementation detail, for now, this secret should be stored in the process environment by the session leader under the name XDG_SESSION_COOKIE. When and if we are able to take advantage of a mechanism in the underlying system to store session registration information - we will. However, such a mechanism is not known at the present time.
Using an environment variable does have certain advantages. For one, it is quite easy for a process to opt-out of a Session by simply unsetting the XDG_SESSION_COOKIE variable.
Limitations of using an environment variable implementation include not being able to strictly limit visibility of the secret to a particular process ancestry. So, it is not possible to enforce session boundaries other than on a per-user basis. For example, we don't yet have a way to prevent a process from moving between sessions owned by the same user.
The session leader is the process that requests that a new session be opened. It does this by connecting to the D-Bus system bus and using either org.freedesktop.ConsoleKit.Manager.OpenSession() or org.freedesktop.ConsoleKit.Manager.OpenSessionWithParameters(). The session that it registers will remain open until the connection to the system bus is lost or it calls org.freedesktop.ConsoleKit.Manager.CloseSession().
The session leader is the only process for which CloseSession() will be allowed.
A seat is a collection of sessions and a set of hardware (usually at least a keyboard and mouse). Only one session may be active on a seat at a time.
At the present time, all Sessions that are considered "local" to a system will be added the the first Seat and every other Session will be added to its own Seat.
True, hardware, multi-seat capabilities will be added in a later release.
Table of Contents
The session leader process is responsible for asking ConsoleKit2 to open a new session. In this respect, it is similar to the traditional POSIX user login accounting framework. In the typical case, the session leader is either an immediate descendant of a login manager or the login manager itself. The leader makes a connection to the D-Bus system bus and asks ConsoleKit2 to open a session. There are two methods available for opening a session: org.freedesktop.ConsoleKit.Manager.OpenSession() and org.freedesktop.ConsoleKit.Manager.OpenSessionWithParameters().
If the operation succeeds, a secret cookie will be returned to the session leader. The session leader should store this secret in the environment as XDG_SESSION_COOKIE so that it may be shared with its child processes.
At this point the session will be registered with ConsoleKit2 and a particular set of information about the session will be stored along with it.
ConsoleKit2 will decide, based on the information associated with the session, what Seat the session will be added to.
It will also be determined, based on the same set of information, whether the Session will control the hardware associated with the Seat. In other words, whether the Session will be active for the Seat it is attached to. The exact mechanism for this determination depends on the type of Seat and the capabilities of the host system.
The Session will remain open until the Session Leader disconnects from the D-Bus system bus or calls org.freedesktop.ConsoleKit.Manager.CloseSession(). The session will be removed from its Seat, and deregistered.
Use of this service will usually follow one of the following patterns:
This pattern operates as the Session Leader for a new Session. This pattern needs:
In addition to the requirements for the Text Graphical Login Manager, this pattern is typically used to show information about currently open sessions. It needs:
This is generally a daemon process running outside of a user session as a special user. This pattern needs:
This is a special case of System Daemon that provides catalogs and control mechanisms for hardware devices. In addition to the requirements of System Daemon, this pattern needs:
This is related to the Graphical Login Manager and provides a shortcut to similar functionality. It is usually a tool available in the user session that allows one to quickly switch to another user session. This pattern needs:
This is typically a daemon running in a user session that acts on policy only when the session is active. This pattern needs:
Table of Contents
ConsoleKit2 provides a D-Bus API for programs to obtain information about the users, sessions, and seats that are present on a system.
Please see the other sections of this manual for an introduction to these concepts.
This API is not yet stable and is likely to change in the future.
Table of Contents
org.freedesktop.ConsoleKit.Manager — Manager interface
Restart () CanRestart (out 'b' can_restart) Stop () CanStop (out 'b' can_stop) Reboot (in 'b' policykit_interactivity) CanReboot (out 's' can_reboot) PowerOff (in 'b' policykit_interactivity) CanPowerOff (out 's' can_poweroff) Suspend (in 'b' policykit_interactivity) CanSuspend (out 's' can_suspend) Hibernate (in 'b' policykit_interactivity) CanHibernate (out 's' can_hibernate) HybridSleep (in 'b' policykit_interactivity) CanHybridSleep (out 's' can_hybridsleep) Inhibit (in 's' what, in 's' who, in 's' why, in 's' mode, out 'h' fd) ListInhibitors (out 'a(ssssuu)' inhibitors) OpenSession (out 's' cookie) OpenSessionWithParameters (in 'a(sv)' parameters, out 's' cookie) CloseSession (in 's' cookie, out 'b' result) GetSeats (out 'ao' seats) GetSessions (out 'ao' sessions) GetSessionForCookie (in 's' cookie, out 'o' ssid) GetSessionForUnixProcess (in 'u' pid, out 'o' ssid) GetCurrentSession (out 'o' ssid) GetSessionsForUnixUser (in 'u' uid, out 'ao' sessions) GetSessionsForUser (in 'u' uid, out 'ao' sessions) GetSystemIdleHint (out 'b' idle_hint) GetSystemIdleSinceHint (out 's' iso8601_datetime)
SeatAdded ('o' sid) SeatRemoved ('o' sid) SystemIdleHintChanged ('b' hint) PrepareForShutdown ('b' active) PrepareForSleep ('b' active)
Objects implementing org.freedesktop.ConsoleKit.Manager also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties
Restart ()
This method initiates a request to restart (ie. reboot) the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
CanRestart (out 'b' can_restart)
This method returns whether the user is authorized to restart the computer system.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
can_restart
:Stop ()
This method initiates a request to stop (ie. shutdown) the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
CanStop (out 'b' can_stop)
This method returns whether the user is authorized to shutdown the computer system.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
can_stop
:Reboot (in 'b' policykit_interactivity)
This method emulates the logind implementation. This method initiates a request to reboot the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
Since 0.9.2
policykit_interactivity
:CanReboot (out 's' can_reboot)
This method emulates the logind implementation.
Returns whether the system supports rebooting and whether the calling user is eligible to reboot the system.
Returns one of "na", "yes", "no" or "challenge".
If "na" is returned rebooting is not available because of hardware support.
If "yes" is returned rebooting is supported and the user may suspend without further authentication.
If "no" is returned rebooting is available but the user is not allowed to reboot.
If "challenge" is returned rebooting is available, but only after authorization.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
Since 0.9.2
can_reboot
:PowerOff (in 'b' policykit_interactivity)
This method initiates a request to shutdown the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
Since 0.9.2
policykit_interactivity
:CanPowerOff (out 's' can_poweroff)
This method emulates the logind implementation.
Returns whether the system supports shutdown and whether the calling user is eligible to shutdown the system.
Returns one of "na", "yes", "no" or "challenge".
If "na" is returned shutdown is not available because of hardware support.
If "yes" is returned shutdown is supported and the user may hibernate without further authentication.
If "no" is returned shutdown is available but the user is not allowed to shutdown.
If "challenge" is returned shutdown is available, but only after authorization.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
Since 0.9.2
can_poweroff
:Suspend (in 'b' policykit_interactivity)
This method initiates a request to suspend the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
Since 0.9.2
policykit_interactivity
:CanSuspend (out 's' can_suspend)
This method emulates the logind implementation.
Returns whether the system supports suspending and whether the calling user is eligible to hibernate the system.
Returns one of "na", "yes", "no" or "challenge".
If "na" is returned suspending is not available because of hardware support.
If "yes" is returned suspending is supported and the user may suspend without further authentication.
If "no" is returned suspending is available but the user is not allowed to suspend.
If "challenge" is returned suspending is available, but only after authorization.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
Since 0.9.1
can_suspend
:Hibernate (in 'b' policykit_interactivity)
This method initiates a request to hibernate the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
Since 0.9.2
policykit_interactivity
:CanHibernate (out 's' can_hibernate)
This method emulates the logind implementation.
Returns whether the system supports hibernation and whether the calling user is eligible to hibernate the system.
Returns one of "na", "yes", "no" or "challenge".
If "na" is returned hibernation is not available because of hardware support.
If "yes" is returned hibernation is supported and the user may hibernate without further authentication.
If "no" is returned hibernation is available but the user is not allowed to hibernate.
If "challenge" is returned hibernation is available, but only after authorization.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
Since 0.9.1
can_hibernate
:HybridSleep (in 'b' policykit_interactivity)
This method initiates a request to hybrid sleep (suspend + hibernate) the computer system.
May fail with: CK_MANAGER_ERROR_INHIBITED, CK_MANAGER_ERROR_INSUFFICIENT_PERMISSION, CK_MANAGER_ERROR_AUTHORIZATION_REQUIRED, CK_MANAGER_ERROR_GENERAL, CK_MANAGER_ERROR_BUSY
Since 0.9.2
policykit_interactivity
:CanHybridSleep (out 's' can_hybridsleep)
This method emulates the logind implementation.
Returns whether the system supports hybrid sleep (suspend + hibernate) and whether the calling user is eligible to hybrid sleep the system.
Returns one of "na", "yes", "no" or "challenge".
If "na" is returned hybrid sleeping is not available because of hardware support.
If "yes" is returned hybrid sleeping is supported and the user may hybrid sleep without further authentication.
If "no" is returned hybrid sleeping is available but the user is not allowed to hybrid sleep.
If "challenge" is returned hybrid sleeping is available, but only after authorization.
May fail with: CK_MANAGER_ERROR_FAILED if polkit is used and fails checking authorization.
Since 0.9.1
can_hybridsleep
:Inhibit (in 's' what, in 's' who, in 's' why, in 's' mode, out 'h' fd)
Inhibit locks are named pipes used by ConsoleKit2 to prevent the system from performing actions such as suspending, restarting, or going idle. There are various reasons and application would like to prevent one or more of these functions such as a movie player preventing the screen saving from activating or a package manager ensuring an application installs before allowing the computer to shutdown.
Note: Each application can have only one lock open at any given time. Multiple applications can hold locks to the same thing, for example a media player application and a cd burning application can both prevent the system from being marked idle.
May fail with: CK_MANAGER_ERROR_INVALID_INPUT, CK_MANAGER_ERROR_OOM, CK_MANAGER_ERROR_GENERAL
Since 0.9.0
See this simple example:
DBusConnection *bus_connection; DBusMessage *message = NULL, *reply = NULL; DBusError error; gint fd = -1; const char *what = "shutdown:sleep"; const char *who = "Xfburn"; const char *why = "Burning a DVD, interrupting now will ruin the DVD."; const char *mode = "block"; message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager", "Inhibit"); if (!message) { g_warning ("Unable to call Inhibit()"); return fd; } if (!dbus_message_append_args (message, DBUS_TYPE_STRING, &what, DBUS_TYPE_STRING, &who, DBUS_TYPE_STRING, &why, DBUS_TYPE_STRING, &mode, DBUS_TYPE_INVALID)) { g_warning ("Unable to call Inhibit()"); dbus_message_unref (message); return fd; } reply = dbus_connection_send_with_reply_and_block (bus_connection, message, -1, &error); if (!reply) { g_warning ("Unable to inhibit: %s", error.message); dbus_message_unref (message); return fd; } if (!dbus_message_get_args (reply, &error, DBUS_TYPE_UNIX_FD, &fd, DBUS_TYPE_INVALID)) { g_warning ("Inhibit() reply parsing failed: %s", error.message); } dbus_message_unref (message); dbus_message_unref (reply); dbus_error_free (&error); return fd;
what
:who
:why
:mode
:fd
:ListInhibitors (out 'a(ssssuu)' inhibitors)
This method emulates the logind implementation.
Returns the current list of inhibitors, an array of strings representing the what, who, why, mode, and two unsigned int32 representing the user ID and process ID.
May fail with: CK_MANAGER_ERROR_GENERAL or CK_MANAGER_ERROR_NOTHING_INHIBITED.
Since 0.9.5
inhibitors
:OpenSession (out 's' cookie)
This method requests that a new Session be created for the calling process. The properties of this new Session are set automatically from information collected about the calling process.
This new session exists until the calling process disconnects from the system bus or
calls CloseSession()
.
It is the responsibility of the calling process to set the environment variable XDG_SESSION_COOKIE to the value of the returned cookie. This cookie should only be made available to child processes of the caller so that they may be identified as members of this session.
May fail with: CK_MANAGER_ERROR_GENERAL
See this simple example:
DBusError error; DBusMessage *message; DBusMessage *reply; message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager", "OpenSession"); if (message == NULL) { goto out; } dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connector->connection, message, -1, &error); if (reply == NULL) { goto out; } dbus_error_init (&error); if (! dbus_message_get_args (reply, &error, DBUS_TYPE_STRING, &cookie, DBUS_TYPE_INVALID)) { goto out; }
cookie
:
See also:
OpenSessionWithParameters()
OpenSessionWithParameters (in 'a(sv)' parameters, out 's' cookie)
This method requests that a new Session be created for the calling process. The properties of this new Session are from the parameters provided.
This new session exists until the calling process disconnects from the system bus or
calls CloseSession()
.
It is the responsibility of the calling process to set the environment variable XDG_SESSION_COOKIE to the value of the returned cookie. This cookie should only be made available to child processes of the caller so that they may be identified as members of this session.
See the Session properties for a list of valid parameters.
May fail with: CK_MANAGER_ERROR_GENERAL
parameters
:cookie
:See also: org.freedesktop.ConsoleKit.Session
CloseSession (in 's' cookie, out 'b' result)
This method is used to close the session identified by the supplied cookie.
The session can only be closed by the same process that opened the session.
cookie
:result
:GetSeats (out 'ao' seats)
This gets a list of all the Seats that are currently present on the system.
Each Seat ID is an D-Bus object path for the object that implements the Seat interface.
seats
:See also: org.freedesktop.ConsoleKit.Seat
GetSessions (out 'ao' sessions)
This gets a list of all the Sessions that are currently present on the system.
Each Session ID is an D-Bus object path for the object that implements the Session interface.
sessions
:See also: org.freedesktop.ConsoleKit.Session
GetSessionForCookie (in 's' cookie, out 'o' ssid)
Returns the session ID that is associated with the specified cookie.
May fail with: CK_MANAGER_ERROR_GENERAL
cookie
:ssid
:GetSessionForUnixProcess (in 'u' pid, out 'o' ssid)
Attempts to determine the session ID for the specified POSIX process ID (pid).
May fail with: CK_MANAGER_ERROR_GENERAL
pid
:ssid
:GetCurrentSession (out 'o' ssid)
Attempts to determine the session ID that the caller belongs to.
May fail with: CK_MANAGER_ERROR_GENERAL
See this example of using dbus-send:
dbus-send --system --dest=org.freedesktop.ConsoleKit \ --type=method_call --print-reply --reply-timeout=2000 \ /org/freedesktop/ConsoleKit/Manager \ org.freedesktop.ConsoleKit.Manager.GetCurrentSession
ssid
:GetSessionsForUnixUser (in 'u' uid, out 'ao' sessions)
This gets a list of all the Sessions that are currently open for the specified user.
Each Session ID is an D-Bus object path for the object that implements the Session interface.
uid
:sessions
:GetSessionsForUser (in 'u' uid, out 'ao' sessions)
This gets a list of all the Sessions that are currently open for the specified user.
Each Session ID is an D-Bus object path for the object that implements the Session interface.
uid
:sessions
:GetSessionsForUser
is deprecated since version 0.1.3 and should not be used in newly-written code. Use
GetSessionsForUnixUser
instead.
GetSystemIdleHint (out 'b' idle_hint)
Returns TRUE if the idle-hint
property of every open session is TRUE or if there are no open sessions.
idle_hint
:SeatAdded ('o' sid)
Emitted when a Seat has been added to the system.
sid
:SeatRemoved ('o' sid)
Emitted when a Seat has been removed from the system.
sid
:SystemIdleHintChanged ('b' hint)
Emitted when the value of the system-idle-hint has changed.
hint
:PrepareForShutdown ('b' active)
Emitted when the system is halting (active = TRUE). If successful there will not be a FALSE signal emitted since the system will poweroff or reboot. It will emit a FALSE signal if the shutdown operation failed.
active
:org.freedesktop.ConsoleKit.Seat — Seat interface
GetId (out 'o' sid) GetSessions (out 'ao' sessions) GetDevices (out 'a(ss)' devices) GetActiveSession (out 'o' ssid) CanActivateSessions (out 'b' can_activate) ActivateSession (in 'o' ssid)
ActiveSessionChanged ('o' ssid) SessionAdded ('o' ssid) SessionRemoved ('o' ssid) DeviceAdded ('(ss)' device) DeviceRemoved ('(ss)' device)
Objects implementing org.freedesktop.ConsoleKit.Seat also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties
A seat is a collection of sessions and a set of hardware (usually at least a keyboard and mouse). Only one session may be active on a seat at a time.
GetSessions (out 'ao' sessions)
This gets a list of all the Sessions that are currently attached to this seat.
Each Session ID is an D-Bus object path for the object that implements the Session interface.
sessions
:GetDevices (out 'a(ss)' devices)
This gets a list of all the devices that are currently associated with this seat.
Each device is an D-Bus structure that represents the device type and the device id.
devices
:GetActiveSession (out 'o' ssid)
Gets the Session ID that is currently active on this Seat.
Fails with CK_SEAT_ERROR_NO_ACTIVE_SESSION if there is no active session.
ssid
:CanActivateSessions (out 'b' can_activate)
Used to determine whether the seat supports session activation.
can_activate
:ActivateSession (in 'o' ssid)
Attempt to activate the specified session. In most cases, if successful, this will cause the session to become visible and take control of the hardware that is associated with this seat.
May fail with: CK_SEAT_ERROR_FAILED, CK_SEAT_ERROR_ALREADY_ACTIVE, CK_SEAT_ERROR_NOT_SUPPORTED
ssid
:
See also:
Activate()
ActiveSessionChanged ('o' ssid)
Emitted when the active session has changed.
ssid
:SessionAdded ('o' ssid)
Emitted when a session has been added to the seat.
ssid
:SessionRemoved ('o' ssid)
Emitted when a session has been removed from the seat.
ssid
:org.freedesktop.ConsoleKit.Session — Session interface
GetId (out 'o' ssid) GetSeatId (out 'o' sid) GetSessionType (out 's' type) GetUser (out 'u' uid) GetUnixUser (out 'u' uid) GetX11Display (out 's' display) GetX11DisplayDevice (out 's' x11_display_device) GetDisplayDevice (out 's' display_device) GetRemoteHostName (out 's' remote_host_name) GetLoginSessionId (out 's' login_session_id) IsActive (out 'b' active) IsLocal (out 'b' local) GetCreationTime (out 's' iso8601_datetime) Activate () Lock () Unlock () GetIdleHint (out 'b' idle_hint) GetIdleSinceHint (out 's' iso8601_datetime) SetIdleHint (in 'b' idle_hint)
Objects implementing org.freedesktop.ConsoleKit.Session also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties
'unix-user' readwrite 'u' 'user' readwrite 'u' 'session-type' readwrite 's' 'remote-host-name' readwrite 's' 'display-device' readwrite 's' 'x11-display' readwrite 's' 'x11-display-device' readwrite 's' 'active' readwrite 'b' 'is-local' readwrite 'b' 'idle-hint' readwrite 'b'
Session objects represent and store information related to a user session.
The properties associated with the Session specifically refer to the properties of the "session leader".
GetSeatId (out 'o' sid)
Returns the ID for the Seat the Session is attached to.
May fail with CK_SESSION_ERROR_FAILED if the session isn't attached to a seat
sid
:See also: org.freedesktop.ConsoleKit.Seat
GetSessionType (out 's' type)
Returns the type of the session.
Warning: we haven't yet defined the allowed values for this property. It is probably best to avoid this until we do.
type
:
See also:
session-type
GetUser (out 'u' uid)
Returns the user that the session belongs to.
uid
:GetUser
is deprecated since version 0.1.3 and should not be used in newly-written code. Use
GetUnixUser
instead.
See also:
user
GetUnixUser (out 'u' uid)
Returns the POSIX user ID that the session belongs to.
uid
:
See also:
unix-user
GetX11Display (out 's' display)
Returns the value of the X11 DISPLAY for this session if one is present.
display
:
See also:
x11-display
GetX11DisplayDevice (out 's' x11_display_device)
Returns the value of the display device (aka TTY) that the X11 display for the session is connected to. If there is no x11-display set then this value is undefined.
x11_display_device
:
See also:
x11-display-device
GetDisplayDevice (out 's' display_device)
Returns the value of the display device (aka TTY) that the session is connected to.
display_device
:
See also:
display-device
GetRemoteHostName (out 's' remote_host_name)
Returns the value of the remote host name for the session.
remote_host_name
:
See also:
remote-host-name
GetLoginSessionId (out 's' login_session_id)
Returns the value of the login session ID that the underlying system uses to enforce session boundaries. If there is no login session ID set then this value is an empty string.
login_session_id
:IsActive (out 'b' active)
Returns whether the session is active on the Seat that it is attached to.
If the session is not attached to a seat this value is undefined.
active
:
See also:
active
IsLocal (out 'b' local)
Returns whether the session is local
FIXME: we need to come up with a concrete definition for this value. It was originally used as a way to identify XDMCP sessions that originate from a remote system.
local
:
See also:
is-local
GetCreationTime (out 's' iso8601_datetime)
Returns an ISO 8601 date-time string that corresponds to the time that the session was opened.
iso8601_datetime
:Activate ()
Attempt to activate the this session. In most cases, if successful, this will cause the session to become visible and become active on the seat that it is attached to.
May fail with: CK_SESSION_ERROR_ALREADY_ACTIVE, CK_SESSION_ERROR_NOT_SUPPORTED, CK_SESSION_ERROR_GENERAL
See also:
Seat.ActivateSession()
Lock ()
This will cause a Lock
signal to be emitted for this session.
See also:
Lock signal
Unlock ()
This will cause an Unlock
signal to be emitted for this session.
This can be used by login managers to unlock a session before it is re-activated during fast-user-switching.
See also:
Unlock signal
GetIdleHint (out 'b' idle_hint)
Gets the value of the idle-hint
property.
idle_hint
:
See also:
idle-hint
ActiveChanged ('b' is_active)
Emitted when the active property has changed.
is_active
:IdleHintChanged ('b' hint)
Emitted when the idle-hint property has changed.
hint
:Lock ()
Emitted in response to a call to the Lock()
method.
It is intended that the screensaver for the session should lock the screen in response to this signal.
Unlock ()
Emitted in response to a call to the Unlock()
method.
It is intended that the screensaver for the session should unlock the screen in response to this signal.
'user' readwrite 'u'
The user assigned to the session.
user
is deprecated since version 0.1.3 and should not be used in newly-written code. Use
unix-user
instead.
'session-type' readwrite 's'
The type of the session.
Warning: we haven't yet defined the allowed values for this property. It is probably best to avoid this until we do.
'remote-host-name' readwrite 's'
The remote host name for the session.
This will be set in situations where the session is opened and controlled from a remote system.
For example, this value will be set when the session is created from an SSH or XDMCP connection.
'display-device' readwrite 's'
The display device (aka TTY) that the session is connected to.
'x11-display' readwrite 's'
Value of the X11 DISPLAY for this session if one is present.
'x11-display-device' readwrite 's'
The display device (aka TTY) that the X11 display for the session is connected to. If there is no x11-display set then this value is undefined.
'active' readwrite 'b'
Whether the session is active on the Seat that it is attached to.
If the session is not attached to a seat this value is undefined.
'is-local' readwrite 'b'
Whether the session is local
FIXME: we need to come up with a concrete definition for this value. It was originally used as a way to identify XDMCP sessions that originate from a remote system.
'idle-hint' readwrite 'b'
This is a hint used to indicate that the session may be idle.
For sessions with a x11-display
set (ie. graphical
sessions), it is up to each session to delegate the
responsibility for updating this value. Typically, the
screensaver will set this.
However, for non-graphical sessions with a display-device
set
the Session object itself will periodically update this value based
on the activity detected on the display-device itself.
This should not be considered authoritative.