Activity Monitor

The Problem

Several applications need to know about user activity. This includes screen savers, RSI prevention tools like Workrave, and IM programs (for automatic away message). Currently each program has to implement activity tracking itself. This means that there is no unified configuration, but also that programs like movie players have to resort to hacks to prevent screen savers from activating. It’s also not possible for users to trigger a generic “away” event that causes the screen to be locked, the IM program to set the away status etc. pp.

A unified system would have the following requirements:

  • There needs to be an idle time, after which screensavers could active. for example.
  • There needs to an away time, after which the user is considered to be AFK. This could trigger screen locking, and IM status changes.
  • Programs must have the ability to signal user activity, so that screen savers won’t activate while watching a movie.
  • Programs must have the ability to temporarily shut the activity listening off. This is needed by xlock-like programs, where the program itself is the only authority to reenable user activity.

The Proposal

A central daemon (yay, another daemon!) communicates with other program via d-bus. This daemon listens for user activity, i.e. mouse movement and key presses. Basically there are four user states:

The user is currently using the computer.
The user hasn’t used the computer for a set amount of time.
The user is away from the keyboard.
Like “away”, only that wakeup events are ignored until the
mode is manually changed.

In general the possible mode changes are busy → lazy, busy → away, busy → locked, lazy → busy, lazy → away, lazy → locked, away → busy, away → locked, and locked → busy.

The following messages are sent by the daemon:

This specifies are reason for the status change as parameter,
for example “timeout:600”, meaning that there was no user activity
for 600 seconds. This message may be repeated with reason “repeat”.
This message is sent when the user is away. It also includes
the reason, for example “timeout:1200” or “userrequest”. It may
also be repeated.
This message is sent when the user returns to work. It has
an optional reason parameter, and may be repeated.

The daemon understands the following messages:

This is sent by some applications, like movie viewers every
few seconds to signal that the user is busy, although there is
no user activity.
This is sent by applications when the user explicitly toggles
the away status, for example by selecting “lock screen” from the
system menu.
Similar to gone-away, only that auto-wakeup is disabled. The only
entity to reenable listing to events is the sender of the locked
message. Therefore a detail string must be passed. This is used by
xlock-like applications to prevent applications from changing the
“away” status, just because someone moved the mouse.
The corresponding unlock signal to the locked message. Must use
the same detail string.

Use Cases

Screen Saver
When the screen saver receives the away signal, it
turns on the screen saving (if it’s not already running). If it
receives the busy signal, it turns of the screen saver. It ignores
the other signals.
Away Button
When a user uses a potential away button in the system menu,
the menu sends the “gone-away” message to the daemon.
Screen Lock
When a user uses the “Lock Screen” button in the system
menu, the menu sends the “locked” signal to the daemon. It starts
the screen saver and listens to user input. When the correct
password has been entered, it sends the “unlocked” signal and
ends the screen saver mode.
Screen Saver with Locking
When the screen saver receives the away signal, it starts
screen saving, and sends the “locked” signal to the daemon. When
there is user input and the correct password is entered, it sends
the “unlocked” signal.
Instant Messengers
When the IM program receives the “away” signal, it turns
on the auto-responser and possibly the away method. The
auto-responder message may be modified according to the reason
detail parameter. When the IM program receives the busy signal,
it turns auto-responding and away status off.

To Do

  • The current proposal does not address RSI prevention programs like Workrave.
  • Security implications of the locked mode.
  • The disparity in screen saver responsibilities between normal screen saver activation and xlock activation.

Blog Comments

I’ve finally managed to implement comments for my blog. I’m still playing around with the code and especially the layout, but I think it’s an important step forward. The future will probably bring a few more features, like:

  • Improved layout
  • E-mail notifications for new comments
  • Trackback support
Software Development


Mark Pilgrim posted a great article about the problems of many committee standardization processes. Microformats use a different approach: Design for the common case first, think about corner cases only later.

Magic the Gathering

Ravnica Prerelease

We had another Ravnica: City of Guilds prerelease at the FUNtainment Game Center (formely Magic Center). It was a whooping success with a total of 47 participants, much more than I had anticipated for this third prerelease.

This was the content of four Ravnica: Stadt der Gilden boosters

The store was full, since there was a large YuGiOh tournament going on at the same time (“Pharaoh Tour”) with about 150 participants. A Vs event had to be canceled due to a lack of participants. Scheduling such an event as competition to a large YuGiOh and Magic event seems like a poor choice on the part of UDE. But at least some of the Vs players decided to play in the Ravnica prerelease instead, so that we had a few late entrants.

Since the place we usually used for posting pairing was used by the YuGiOh tournament, I had to resort to creativity: A Yugi standup figure was used for the rest of the tournament as pairings holder, despite the protests of an unnamed UDE employee. (“As an official UDE representative, I have to tell you that Yugi is a really cool guy.”)

Due to time problems, caused by the high number of players, the late entrants, and the YuGiOh event going on in parallel, I decided to leave out the deck swap. One of the players, who opened a foil Birds of Paradise was overenjoyed, since he had feared that he’d have to give it away.

Prerelease judges, from left: Christopher Eucken (L1), Cristian Hoof (L2, Scorekeeper), Sebastian Rittau (L2, Head Judge)

One of the side drafts had an interesting problem: Four boosters contained a total of more than 40 rare cards. In most of the boosters the common slots contained rares. We replaced the boosters with boosters from the price pool, and let the players draft from the opened rares at the end of the draft.

Unfortunately I had to leave after three rounds, but I left Cristian Hoof (L2, scorekeeper) and Christopher Eucken (L1) behind, and I’m sure that the tournament was in good hands.

Finally, here is a photo that probably neither Wizards nor Upperdeck would endorse: some of the judges that frequently work at the FUNtainment Game Center in Berlin:

Upper row, from left: Christopher Eucken (L1), Sebastian Rittau (L2), a YuGiOh judge whose name eludes me, Cristian Hoof (L2), Peter Feller (Game Center manager), lower from, from left: Ali (another YuGiOh judge), Soul (a UDE judge)