org.freedesktop.ConsoleKit.Managerorg.freedesktop.ConsoleKit.ManagerManager interfaceMethodsRestart ()
Stop ()
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)
SignalsSeatAdded ('o' sid)
SeatRemoved ('o' sid)
SystemIdleHintChanged ('b' hint)
Implemented Interfacesorg.freedesktop.ConsoleKit.Manager implements
org.freedesktop.DBus.Introspectable,
org.freedesktop.DBus.Properties
PropertiesDescriptionDetailsRestart ()RestartManagerRestart ()This method initiates a request to restart (ie. reboot) the computer system.Stop ()StopManagerStop ()This method initiates a request to stop (ie. shutdown) the computer system.OpenSession ()OpenSessionManagerOpenSession (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.
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:The secret cookie that is used to identify the new session
See also:
OpenSessionWithParameters()OpenSessionWithParameters ()OpenSessionWithParametersManagerOpenSessionWithParameters (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.parameters:An array of sets of property names and valuescookie:The secret cookie that is used to identify the new sessionThis method is restricted to privileged users by D-Bus policy.
See also:
org.freedesktop.ConsoleKit.SessionCloseSession ()CloseSessionManagerCloseSession (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:The secret cookie that is used to identify the sessionresult:Whether the session was successfully closedGetSeats ()GetSeatsManagerGetSeats (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:an array of Seat IDs
See also:
org.freedesktop.ConsoleKit.SeatGetSessions ()GetSessionsManagerGetSessions (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:an array of Session IDs
See also:
org.freedesktop.ConsoleKit.SessionGetSessionForCookie ()GetSessionForCookieManagerGetSessionForCookie (in 's' cookie,
out 'o' ssid)Returns the session ID that is associated with the specified cookie.
cookie:The secret cookie that is used to identify the sessionssid:The object identifier for the current sessionGetSessionForUnixProcess ()GetSessionForUnixProcessManagerGetSessionForUnixProcess (in 'u' pid,
out 'o' ssid)Attempts to determine the session ID for the specified
POSIX process ID (pid).
pid:The POSIX process IDssid:The object identifier for the current sessionGetCurrentSession ()GetCurrentSessionManagerGetCurrentSession (out 'o' ssid)Attempts to determine the session ID that the caller belongs to.
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:The object identifier for the current sessionGetSessionsForUnixUser ()GetSessionsForUnixUserManagerGetSessionsForUnixUser (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:POSIX User identificationsessions:an array of Session IDsGetSessionsForUser ()GetSessionsForUserManagerGetSessionsForUser (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:User identificationsessions:an array of Session IDsGetSessionsForUser is deprecated since version 0.1.3 and should not be used in newly-written code. Use
GetSessionsForUnixUser
instead.GetSystemIdleHint ()GetSystemIdleHintManagerGetSystemIdleHint (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:The value of the system-idle-hintGetSystemIdleSinceHint ()GetSystemIdleSinceHintManagerGetSystemIdleSinceHint (out 's' iso8601_datetime)Returns an ISO 8601 date-time string that corresponds to
the time of the last change of the system-idle-hint.
iso8601_datetime:An ISO 8601 format date-type stringSignal DetailsThe SeatAdded signalSeatAddedManagerSeatAdded ('o' sid)Emitted when a Seat has been added to the system.
sid:The Seat ID for the added seatThe SeatRemoved signalSeatRemovedManagerSeatRemoved ('o' sid)Emitted when a Seat has been removed from the system.
sid:The Seat ID for the removed seatThe SystemIdleHintChanged signalSystemIdleHintChangedManagerSystemIdleHintChanged ('b' hint)Emitted when the value of the system-idle-hint has changed.
hint:The value of the system-idle-hintProperty Details