gnome-power-manager and multiple batteries

In times of 2-21 to 2-25, gnome-power-manager maintained an big fat elaborate cache of power devices and combination devices which was populated by HAL. This allowed us to have “virtual” devices such as multiple composite laptop batteries. This abstraction sucked and made some horrible assumptions about devices. And it was slow.

These virtual batteries were used for policy, and generally multiple batteries sort-of-just-worked, with a few random things happening when the engine virtual layer fell down. I couldn’t test virtual devices, as my Toshiba only had one battery with no expansion available, so I relied on random patches from strangers.

Fast forward to last-week/2-26/DeviceKit. Now gnome-power-manager had a very small new ‘thin’ engine with all the devices supplied by DeviceKit-power. Batteries, on the whole were a whole lot more predictable, and the architecture was at last fairly sane. I had now got a nice shiny Thinkpad, still with only one battery, but with extra space for another. But wait, I know what you are thinking; Thin engine means no composite devices, which makes people with multiple battery laptops sad.

Fast forward to this weekend/2-27/DeviceKit. My ultrabay battery arrived in the post from the US (with customs charge, bahh) which I plugged in to the Thinkpad. Much hacking was done, and a few changes (related to empty batteries) went into DeviceKit-power and a few changes went into gnome-power-manager. Now we have a composite store with a thin engine, so the best of both worlds.

So, long story, short: if you have laptop with multiple batteries and your experience with gnome-power-manager sucks, update to git versions of DeviceKit-power and gnome-power-manager. I’ll be making releases later this week, and backporting to stable once it’s had some testing.

Does your project use PackageKit?

Yesterday, somebody asked me on IRC if there was a list of projects using PackageKit. I said no. I’m now adding a section on the website with just this content.

So, please send an email to me or the mailing list if your project is using PackageKit BY DEFAULT. This doesn’t mean “can be installed on”, but means “is usable when freshly installed”. I think it makes sense to add projects like nautilus that hook into the session interface too.

So far we’ve got replies from Fedora, Foresight, Moblin and Kubuntu. If you’re interested, please follow the instructions here or email me off-list. Thanks.

New web host

I’m looking for ideas for a web host to replace namezero. I’ve been with namezero for years and years for my personal website mostly due to laziness, but now their service has got beyond a joke and I’m looking for a replacement.

Can anyone recommend a (possibly UK based) hosting provider? I need about 1GB/month, about 50Mb webspace. I need just apache for static HTML pages, no MySQL, PHP, or any CMS fancy-whatsits. I need to transfer a single .com domain, and setup a few mail redirects — no mailboxes needed.

I don’t mind paying a little extra for uptime or for a company that isn’t going to go bust anytime soon. Ideas welcome. Thanks.

Richard.

GNOME Power Manager unstableness

Recently there has been a period of where gnome-power-manager wasn’t quite as stable and bug free as I would like. The reasons basically boil down to:

  • Rewriting the engine to support DeviceKit-power rather than HAL
  • Switching to using xbacklight rather than HAL to change the backlight (but falling back to HAL if xbacklight is not available)
  • Rewriting the idle interactions to not rely on gnome-screensaver, but instead using gnome-session and X idletime
  • Supporting HAL buttons and X buttons, and trying to filter out the duplicates
  • Working around the fact that switching the monitor off using DPMS resets the IDLETIME…. urgh.
  • Switching to using DeviceKit-power to do the suspend and hibernate, instead of using HAL

So, for the last few months I’ve been essentially trying to do the software equivalent of underpinning a house. I’ve spent the last couple of days adding more self check code, and fixing up the bugs that the new tests have found. Specifically, if your machine randomly switched off your display when you’re working, or when switching sessions didn’t restore your brightness correctly then git master probably might work for you.

Could people that have had problems, please try git master and give me success/failure as comments to the blog comment please. If the idletime and dimming stuff is 100% fixed now, then I’ll backport the fixes to stable and do a new release. Thanks.

p.s. If you change the value of GPM_USE_COMPOSITE in src/gpm-engine.c to 1 and recompile, then multiple batteries might work correctly too. Untested (still waiting for my ultra-bay battery to be delivered), so no promises.

GNOME PackageKit updates

A few nice things have been happening lately. The first is the re-versioning of 0.4.4 to 2.27.1, so that we can stick to GNOME release versions and the promise of release freezes. This should make it a bit easier for distributors, and will make the transition to gnome.org a little bit easier.

We’ve also been doing some tinkering around the edges to make things work better, hopefully without getting in the way. This is shown quite nicely from the following UI from the new update viewer.

Saving you money every day of the week...
Saving you money every day of the week...

And, thanks to Daniel Nicoletti, PackageKit now understands media requests, so the backends can request the user do something with physical media. This is still using the non-blocking logic we’ve always been using, so if we’re using multiple disks then the content has to be copied off each one in turn before the transaction, rather then installing direct from the media. Trust me, it’s better this way.

New media change dialog
New media change dialog

We’ve also been removing some dead code (libsexy, libglade, etc), and tidying up the existing objects, so hopefully 2.27.2 can be released in a few weeks. Comments, as always, welcomed.

Converting to GtkBuilder

This evening I’ve been trying to convert my projects (gnome-packagekit and gnome-power-manager) away from libgade to the shinier GtkBuilder. One less library, right? So far so good, except for the fancy super sexy custom widgets.

Stuff like the graph widget in gnome-power-statistics was created using the glade_set_custom_handler function, which was then creating the widget using gpm_graph_widget_new() in that callback. I’m not sure how to do this with GtkBuilder and the new markup format. Google isn’t being very helpful. Help appreciated. Thanks!

The next update viewer

We’ve got a new experimental update viewer in GNOME PackageKit. It looks something like this:

It’s currently called gpk-update-viewer2, and isn’t the default yet. I’ve patched Fedora rawhide to use it by default so we can get some early feedback and testing.

UI feedback welcome. Some of those strings are mighty difficult to understand, for instance, my fiancĂ©e didn’t know what a production system was. I also don’t like how the URL’s look. Ideas please. Thanks.