org.freedesktop.ConsoleKit.Manager org.freedesktop.ConsoleKit.Manager Manager interface Methods Restart () 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) Signals SeatAdded ('o' sid) SeatRemoved ('o' sid) SystemIdleHintChanged ('b' hint) Implemented Interfaces org.freedesktop.ConsoleKit.Manager implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Description Details<anchor role="function" id="Manager.Restart"/>Restart ()RestartManagerRestart () This method initiates a request to restart (ie. reboot) the computer system. <anchor role="function" id="Manager.Stop"/>Stop ()StopManagerStop () This method initiates a request to stop (ie. shutdown) the computer system. <anchor role="function" id="Manager.OpenSession"/>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()<anchor role="function" id="Manager.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.Session<anchor role="function" id="Manager.CloseSession"/>CloseSession ()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 closed<anchor role="function" id="Manager.GetSeats"/>GetSeats ()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.Seat<anchor role="function" id="Manager.GetSessions"/>GetSessions ()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.Session<anchor role="function" id="Manager.GetSessionForCookie"/>GetSessionForCookie ()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 session<anchor role="function" id="Manager.GetSessionForUnixProcess"/>GetSessionForUnixProcess ()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 session<anchor role="function" id="Manager.GetCurrentSession"/>GetCurrentSession ()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 session<anchor role="function" id="Manager.GetSessionsForUnixUser"/>GetSessionsForUnixUser ()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 IDs<anchor role="function" id="Manager.GetSessionsForUser"/>GetSessionsForUser ()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.<anchor role="function" id="Manager.GetSystemIdleHint"/>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-hint<anchor role="function" id="Manager.GetSystemIdleSinceHint"/>GetSystemIdleSinceHint ()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 string Signal Details<anchor role="function" id="Manager::SeatAdded"/>The SeatAdded signalSeatAddedManagerSeatAdded ('o' sid) Emitted when a Seat has been added to the system. sid:The Seat ID for the added seat<anchor role="function" id="Manager::SeatRemoved"/>The SeatRemoved signalSeatRemovedManagerSeatRemoved ('o' sid) Emitted when a Seat has been removed from the system. sid:The Seat ID for the removed seat<anchor role="function" id="Manager::SystemIdleHintChanged"/>The SystemIdleHintChanged signalSystemIdleHintChangedManagerSystemIdleHintChanged ('b' hint) Emitted when the value of the system-idle-hint has changed. hint:The value of the system-idle-hint Property Details