A small utility you probably don't know

Back when I wrote the Bazaar Power Management plugin (still the only VCS with desktop power integration) I also wrote a small little command line utility. The utility came out of a discussion at UDS that no one wanted computers sleep by default if there was no easy way for command line apps to ensure that the computer won't go to sleep while they're running. I really want all Linux desktops to sleep by default. So I wrote this small utility.

And a few people asked me questions, which resulted in me sending it to them, and then I thought that I'd just make things simple and put it into the gnome-power-manager package for everyone. And I did. And that shipped with Intrepid. But nobody uses it because I never promoted it. Now I am.

If you go and you call the utility gnome-power-manager-inhibit it won't do much. That's because it works similarly to nice and time in that it works while the rest of the command line is running. So if you do:

$ gnome-power-manager-inhibit ls
Then you can rest assured that your computer won't go to sleep while listing that directory. What is more common for me is that I'll kick off a build before going to bed:
$ gnome-power-manager-inhibit make install
Where I know that if the build takes over a half hour (my configured sleep time) the computer won't go to sleep. But, my computer will be asleep when I wake up in the morning.

I hope that helps people to start configuring their laptops (and desktops) to sleep automatically. It really is important.

posted on Fri, 23 Jan 2009 at 23:28 | permanent link | 3 Comments

Posted by ethana2 at Sat Jan 24 17:58:50 2009
I leave my machine on 24/7 for IRC and torrents.  I wish I had some kind of ARM chip that could do that instead of this Core2 Duo..  like my phone, I leave that on all the time too, it's probably ARM.

Posted by Athrun at Mon Jan 26 05:13:23 2009
Is this included in the upstream package too or is it Ubuntu-specific?

Posted by Ted Gould at Mon Jan 26 09:15:53 2009
@Athrun, it's be submitted upstream but I don't believe that it's been included.  It is very tiny, so I can send it to you if you'd like.

Name:


OpenID:


Comment: