Workrave, with no fake microbreaks

I’ve been using Workrave to help me remember to take breaks from the computer. I always end up not using it after a while though.

That’s because I get irritated by it because it gets frustrating after a while. I’ve always been a bit too optimistic about my breaks. Specifically because the program comes with an insane setting as standard.

However, this time I’ve set the settings to:

  • One two-minute microbreak every hour.
  • One ten minute break every three hours.
  • Eight hour PC-time, give me one extra hour three times if I ask for it.

Hope I’ll use it for a longer time now.

A key press is an activity!

I quickly found another of my common irritations after using it. Workrave is not detecting my keypresses properly, so even though I am sitting at the computer, it thinks I’m not.

This especially happens with the microbreaks, they never seem to actually work. I’m very often reading stuff on the screen, only pressing “Page down” button once every 10 seconds.

The reason Workrave behaves so strangely is because it uses an algorithm like this:

  • Get keyinput / mousemove or whatever
  • If mode is MODE_IDLE:
    • Set mode MODE_NOISE
    • Set last_time to now
  • Else if mode is MODE_NOISE:
    • If last_time is more than ACTIVITY ms ago, set mode to MODE_ACTIVE.

So, as you see, there’s a config setting ACTIVITY that messes things up. The code is not exactly like that, but close enough.

Anyway, when I found out that, I was happy. Easy fix!

But not so easy anyway. I saw there was a config system going on there, and tried finding the workrave.ini file residing in .workrave/. Sadly, I couldn’t find it, so I made it, with:

[monitor]
activity=0

Ok, that worked. It dumped a whole lot of new config options into that file, and when restarting Workrave, it stopped working. That was probably because many of the options were truly bogus.

Instead of fixing it, — I found out that my default config provider was gconf, so I rather did it that way.

The real fix

Opening up gconf-editor, I browsed to apps/workrave and inputted "monitor/activity" as an integer with value 0.

Restarting Workrave, and lo! It resets the counter when you press one button, just as I wanted!

Other irritations

It also doesn’t react on the mouse when it’s moved less than 3 pixels from where it was. That’s hard coded, so you’d have to change the source and compile it.

Another thing is that with the settings I have, which is 2 minute microbreak every hour, it’s still way too easy for it to register my 2 minute break when I did in fact not use it. It’s very possible for me to read a full screenful of a text (and think hard about it), or watch a video for over 2 minute.

Workrave has it’s own «reading mode» button for that. However, I don’t like that because

  1. I have to remember it
  2. It’s not easily accessible
  3. I have to remember turning it off

I could fix something with point 2 and Workrave’s dbus integration. But, well, it’s still a drag.

I think maybe we could raise the IDLE-time limit. These are the default limits:

NOISE = 9 seconds
ACTIVITY = 1 second
IDLE = 5 seconds

So we know what ACTIVITY is, I’ve set that to 0, so that it doesn’t need 2 events 1 second apart in order to register activity.

NOISE is how long until it waits until it sees a new keyboard input resets its ACTIVITY-lookup. Having that as 9 seconds is OK for me now that I’ve set ACTIVITY to 0.

IDLE is the time it waits until it starts counting. I’m not too happy with it at 5 seconds. I’m using Workrave with much bigger time lapses, so it should be really be upped.

I’ll put IDLE at 60 seconds, so that it won’t start counting IDLE time unless I’ve been off the keyboard for 60 seconds. So this will still make me take my 2 minute microbreak when I’m not touching the computer for 3 minutes, but it won’t happen as often.

So opening up gconf-editor and going to apps/workrave/monitor, and then inputting idle with integer value 0 will fix it.

And then Workrave is better to use!

9 thoughts on “Workrave, with no fake microbreaks”

  1. Hey Odin, thanks for sharing your experiences with workrave. I started using it to day and I also wanted to set the IDLE-time around 60 seconds and more. I opened gconf-editor and found workrave in apps, but no folder named monitor. So you made that folder on your on and inputted the keys on you own, right? I actually I think I don’t understand your manual completely. Maybe you can go in more detail and explain the whole think for me.

    Best regards, Micha

  2. In Windows you can find these settings in the registry. Open up regedit.exe, navigate to HKEY_CURRENT_USER\Software\Workrave and create a new folder called “monitor”. Within that folder, create a new String value called “activity”, “idle”, or “noise”. Give them a value in milliseconds and restart Workrave.

  3. What DOES work on Windows is to change these settings from RegEdit ONLY. I messed with both of them and Workrave got extremely confused. So, stay clear of the INI file on Windows and only use the registry setting. This worked for me: http://pastebin.com/r88r8Df7 . The values are in microseconds. Save that pastebin as .reg and execute it if you trust it.

    1. That’s awesome! I’ll paste the reg file contents here, in case pastebin goes tits up:

      [HKEY_CURRENT_USER\Software\Workrave\monitor]
      "idle"="60000"
      "activity"="0"
      "noise"="9000"
  4. WOW this is awesome! I know nothing about computers and I was able to fix this fake microbreaks problem with your tips. Thank you very much everybody. Thanks Csaba for this settings in WINDOWS.

  5. Thank you great for the post and to whees for the tip about “monitor” folder in linux!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.