Session Presence Manager

"A screencast is worth a thousand words"



The idea behind Session Presence Manager is to provide a central resource for applications to query when interested in the user's presence status in the current desktop session.


The Problem

Leaving my computer used to mean pressing the "pause" key on my keyboard to pause Rhythmbox, and then Ctrl+Alt+L to lock my screen. In actual fact, all I wanted to do was tell my computer that "I am leaving, do what I want you to do when I leave."

"Why not some clever combination of GNOME Screensaver and Galago?"

GNOME Screensaver currently exposes information on whether it deems the session to be "idle", but has no capacity to detect if you are "busy". Galago exposes Instant Messaging-based information about yourself (via the "Me" person). Not only may these be entirely inconsistent with each other, but either one could just be simply missing. (For example, if you're not using any IM applications (Gaim/Gossip/Telepathy) at the time, should a user still be deprived of this functionality?)

Besides, simply having applications query just one resource rather than two is an obvious benefit.


A status consists of two things: a tuple of well-known status identifiers that identify the nature of the status ("ID"), and a user-provided description ("Description"). These are sent over the bus together in both a response to a GetStatus method call and a StatusChanged signal.

Status IDs

Presence statuses are identified by a sequence of strings that describe the nature of the status in increasing levels of detail. This allows applications to only pay attention to as much detail as they are interested in. Examples include:

  • ("present") meaning "I'm here"
  • ("present", "engaged") meaning "I'm here, but I'm busy"
  • ("absent") meaning "I'm not here"
  • ("absent", "temporary") meaning "I'll be right back"
  • ("absent", "extended") meaning "I'm away for a while"

Status Descriptions

Of course, these are of no use to machines, but your friends might like to know that you are "at the shops". These are only apparently immediately useful for IM applications. User descriptions are UTF-8 strings.

Core Components


The Daemon keeps track of session presence and is responsible for emitting StatusChanged signals over the Session Bus when appropriate. Any client is able to request the current status at any time with the GetStatus method, or set it with the SetStatus method.

GNOME Client

This simple client is a frontend designed for GNOME. It currently adds a status icon to the notification area, which upon clicking reveals a small window with three buttons, "Here", "Busy" or "Away". Clicking these buttons sets the user presence on the daemon, with hardcoded example user status descriptions.

This listens to StatusChanged signals in order to update its own display.

Auxiliary Components

Rhythmbox Plugin

  • Adds "Pause When Away" UI and GConf option


  • Glue app included in 0.0.2
  • Supports "available", "busy" and "away" statuses, complete with user description as of 0.0.4
  • Need to dissolve this functionality into Gossip's main code and add UI for enabling/disabling automatic status updates. There is a case for disabling this functionality, as some users will be concerned with privacy.

GNOME Screensaver

  • Integrated with a "glue" program for now, by disabling idle detection (through the config UI) and having this glue activate/deactivate the screensaver via DBus when appropriate.
  • If we activated the screensaver this way, then a deactivation of the screensaver implies a return of the user to the session. Screensaver can request this change in presence itself, removing the need for the user to otherwise inform the Daemon of a return.
  • Eventually, we need to strip out the idle detection from GSS and put all of this into the Daemon itself.
  • Need to provide DBus API compatibility with legacy apps that request idleness from Screensaver Daemon. It would be simple to proxy the query to SPM

Third-party Support


MiloszDerezynski has added preliminary support to BMP current SVN ( that more-or-less does the same as the Rhythmbox plugin.



We can pull the idle detection out of GNOME Screensaver and into the Daemon for this. I think this means that we will be using the XScreenSaver API.


Either GNOME Screensaver needs a lot of butchering, or a new screensaver needs to be written. I'll provide more details on this when I'm less tired.


Eventually, the protocol will become too complicated to keep using without a library. So a library that deals with obtaining some kind of SessionPresenceManager object, and having PresenceStatus objects passed around instead would be useful.

Console Kit

ConsoleKit likes to be informed of whether the session is "idle". Would it be safe to consider the session to be "idle" when the user is declared "absent"? What are the implications of ConsoleKit's Session idleness? (Need to speak to Jon about this.)

Example code:;a=blob;hb=HEAD;f=src/test-fus

Stolen from:


Run the Daemon (, the GNOME Client (, the GNOME Screensaver Glue ( and the Gossip Glue ( with "python $". The Rhythmbox plugin can be placed in ~/.gnome2/rhythmbox/plugins.



its nice to start a page with a brief intro what this is about. Maybe also add a category -- ThiloPfennig 2007-03-29 11:04:13


Attic/SessionPresence (last edited 2013-11-22 17:54:13 by WilliamJonMcCann)