Pragmattica

October 21, 2009

Caffeine 1.0 Released!

Filed under: Uncategorized — bnsmith @ 8:04 am

It’s official. The “Caffeine for Linux” project has reached 1.0! Only a few short months ago, I was hacking away in secret on the initial 0.1 release of a clone of the original Caffeine for Mac. I had no idea if anyone would be interested in contributing to it, or even using it. I’m very pleased to say that the response has been terrific, and far beyond even my most optimistic predictions. I’m very glad that I took this project on, in part because I now have a version of Caffeine for my Linux box. But the best thing about this project has been having the opportunity to work with such incredibly talented and knowledgeable developers. I have learned so much, and I owe it all to you. Tommy and Isaiah, you’re the best!

But I think that I’ve spent quite long enough waxing nostalgic about the events of the last six months. Moving along…

What is “Caffeine for Linux”?

Caffeine keeps your computer awake! It’s a little coffee-cup applet that sits in the notification area:

pic1

When you click on it, the coffee-cup fills up and keeps your computer from going to sleep:

pic2

It also inhibits the screensaver.

Why is this Important?

Imagine that you’re giving a presentation. The room is illuminated only by the blue glow of the projector, displaying your slides on the screen behind you. You linger on a particularly crucial slide, carefully explaining the subtleties to your mesmerized audience. Several minutes pass, and just as you are about deliver the stunning conclusion, the projector goes dark, displaying only a tiny “No Signal” message in the bottom corner.

I expect that everyone reading this has seen some presentation or other where the display powered off or the screensaver came on halfway through. Don’t let this happen to you!

But That’s Not All!

There are a depressingly large number of fullscreen games available on Linux that don’t properly inhibit the screensaver. With Caffeine, you can fix this problem quite easily; no scripting required. It’s also handy for watching long flash videos without having to tap the Shift key every few minutes. In fact, the new 1.0 auto-activation features make these two things even easier than before.

There are three types of auto-activation that can be configured in the preferences:

pic3

You can configure Caffeine to automatically start preventing the screensaver and powersaving whenever a particular program is running. To set this up, just run the program that should inhibit the screensaver, right-click on the Caffeine applet, select “Preferences”, and then click “Add”. You should see a list of all running processes in the pop-up window. Click the name of the program that you started earlier and click “Add”. Close the preferences window. In about 30 seconds, you should see the coffee-cup applet spontaneously fill up.

If you want to set this up for a fullscreen application, just run the application, wait a minute or so and then quit. When you go into the Caffeine preferences to add a new auto-activation program, your fullscreen application should be listed under the “Recent Processes” tab.

Caffeine can also automatically prevent the screensaver and sleep mode when a flash video is playing in Firefox. This works for many popular flash video websites, most notably youtube.com. Unfortunately, there are also some websites for which this won’t work, like hulu.com (a workaround for this issue is available; see Isaiah’s post for details).

Finally, Caffeine can be configured to auto-activate whenever you play Quake Live, a version of Quake III that you can play for free right in your web browser.

Hopefully, these features will allow you to deal with any powersaving inhibition issues that you encounter on your Linux box. Once you get Caffeine configured, you should never have to think about it again.

Caffeine is also available in several new languages. In some cases, the translations are not totally complete, but are enough for typical day-to-day use.

Installation Instructions

At the moment, the easiest way to install Caffeine is through the project’s PPA. Just copy and paste the following three commands into a terminal:

sudo bash -c "echo 'deb http://ppa.launchpad.net/caffeine-developers/ppa/ubuntu jaunty main' >> /etc/apt/sources.list"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 569113AE
sudo apt-get update && sudo apt-get install caffeine

However, we do hope to get Caffeine 1.0 into the official repositories in the near future.

Where Do We Go From Here?

Caffeine 1.0 now has all of the features that I originally envisioned, and plenty more features on top of that. Still, now that 1.0 is here, I can see now that there is still room for improvement. The major task for the 2.0 release of Caffeine will be to make it easier to configure. We hope to do this through an online database of programs that have difficulty inhibiting powersaving on Linux. Our goal is to implement the capability for Caffeine to regularly download the online database of problematic programs, if the user explicitly enables it. There are some details that still need to be worked out, such as how to prevent a hostile individual from adding well-behaved programs to the database and thus draining people’s batteries unnecessarily. However, if we do manage to figure these things out, then it could become possible to fix all “powersaving-challenged” programs by simply installing Caffeine and enabling the database download feature.

Conclusion

I guess that’s it. If you have any ideas for new features, please post a comment or write a blueprint the project page. If you discover a bug, you can report it here. Finally, I’d like to say thanks to all the people who have contributed to Caffeine for Linux. Your hard work is helping to eliminate a major source of headaches for Linux users, and thus helping to push the whole Linux desktop experience forward.

Advertisements

15 Comments

  1. And when are you going to submit this for inclusion with Ubuntu and it’s default repos?

    Comment by PStryder — October 21, 2009 @ 11:39 am

    • Real soon now! 🙂

      It won’t make it in in time for 9.10, unfortunately, but we’ll be starting the process in the next week or so.

      Comment by bnsmith — October 21, 2009 @ 12:02 pm

  2. here’s the source code for the opposite, the “start screensaver now” command. I bind it to an unused key, and press it when I get up for coffee:

    #!/bin/bash

    dbus-send –session –dest=org.gnome.ScreenSaver –type=method_call \
    –print-reply –reply-timeout=20000 /org/gnome/ScreenSaver \
    org.gnome.ScreenSaver.SetActive boolean:true

    Comment by Anonymous — October 21, 2009 @ 12:22 pm

    • Interesting. So this is kind of like CTRL-ALT-L, but without having to type your password in when you return?

      Comment by bnsmith — October 21, 2009 @ 12:33 pm

    • Wow, what ever happened to the plain old “gnome-screensaver-command –activate”?

      Comment by Daniel Wagner — October 21, 2009 @ 12:59 pm

      • A lot of things like this were moved to dbus / ConsoleKit. Can’t even have a command to switch users any more, or at least none that I could find other than Ctrl+Alt+F#, (Which only works if a user is logged in).

        Comment by Zachariah Thomas — October 21, 2009 @ 2:02 pm

  3. didn’t know about “gnome-screensaver-command –activate” — thanks!

    Comment by Anonymous — October 21, 2009 @ 4:42 pm

  4. Fantastic App! Thanks for your efforts! =D
    For some reason, the app won’t open on my Ubuntu machine. I’m running 9.04 – any ideas?

    Comment by Matthew — October 22, 2009 @ 12:48 am

    • Try running it through the terminal and see what the output is.

      Comment by Tommy Brunn — October 22, 2009 @ 5:18 am

  5. Nice! This should be in the main repo of ubuntu

    Comment by Lode — November 5, 2009 @ 8:17 am

    • Thanks! Now that we’ve released 1.0.1 (for bug fixes) we’re going to start moving toward this goal. There might also be a 1.0.2 bug fix release as well, but I’m sure that we can get something in the 1.0 series into the official repos.

      Comment by bnsmith — November 5, 2009 @ 9:43 am

  6. This seems like a lot of work when we already have the “Power Manager Inhibit Applet”. http://www.gnome.org/projects/gnome-power-manager/

    Comment by david mcreynolds — February 3, 2010 @ 2:01 pm

  7. Is it possible to set a time for how long Caffine will work for?

    Comment by Carleton — October 12, 2010 @ 5:58 pm

  8. Great tool!
    As you planted t in your first announcement here, do you still intend to work on a “proper Kde support”?
    Would be great.

    Comment by Petronov — January 24, 2011 @ 2:18 pm

  9. Now that is really nice little applet. Shame I didn’t know about this when I was using linux!

    Comment by Daniel White — March 10, 2011 @ 7:05 pm


RSS feed for comments on this post.

Blog at WordPress.com.

%d bloggers like this: