:: choice ::
go green!  go red!  go blue!
random good link:
random evil link:
Recording Industry Association of America
random quote:
"Don't bother us with politics, respond those who don't want to learn."
Richard Stallman
visit kde.org! visit debian.org!

Power management goodness: KDE 4.2 will suck less

Battery popup dialog ... power. As Dario has already blogged, we have a great new application in kdebase, scheduled to be released with KDE 4.2 in january. PowerDevil is actually not an application in the traditional sense. PowerDevil delivers the infrastructure for power management in KDE. This means it'll notify you when your battery is running out, it dims your screen a bit when you're idle to save some battery life, it switches to a lower power consumption state when you unplug the AC Adapter, it automatically suspends, hibernates or shuts down when your battery is (near) empty, that kind of stuff. For a user, it's not a real application, but much more a service that handles some tasks for you and doesn't get in the way.

Technically, powerdevil is designed to integrate with KDE's platform-independant infrastructure. So while the actual tasks are very close to the hardware's capabilities, powerdevil is not bound to Linux for example. The code is very portable, thanks to the Solid hardware abstraction. Naturally, PowerDevil uses knotify to tell the user about anything she needs to know, fine-grained control about all notifications is available in the System Settings module.

PowerDevil consists of the following parts:

  • A configuration dialogue in System Settings
  • A kded module that does the background work
  • A KRunner for command-line access to most functions
  • A Plasmoid for quick access to some popular functionality
During the last week, I've done some work on the plasmoid corresponding to powerdevil, and it starts to work nicely. In current KDE's SVN trunk/, you can click on the battery plasmoid and you'll see the dialogue in the screenshot. The idea (should be pretty clear, eh) is that you check some details on the battery status, quickly switch profile (when you want full performance on the road, for example), or re-adjust your brightness. The button at the bottom opens the PowerDevil settings module. The plasmoid still needs some polishing, but thanks to the input from Riccardo, Celeste and others, I think we're pretty close to a smooth UI.
I'd also like to add a "do not suspend or screensave my system while I'm doing this presentation / watching this movie" button. We could implement that with a profile in powerdevil (but that wouldn't cover the screensaver), or -- and I think I prefer that option -- with a "[x] Presentation Mode" checkbox. I figured, we should only prevent the system from suspending after an idle time. The system should still suspend (/ hibernate / shutdown / ...) at the critical battery level. This critical level suspend should also go with some kind of count-down dialog, so you still have the opportunity to '... cancel that damn thing' when you really do not want it to go away. Well, on the TODO. :)

Thanks to the awesome work of pinda, you can drag the battery's pop-up control to the desktop and have it sit there as separate applet. There will be a button in the top-right corner in that case that moves this "extender" back into its original location (the battery applet's popup). Neat-o.

Wacky detail, as you can see, the popup also shows the battery. I've loaded another (simplified) instance of the battery applet there, so that's all animated and shiny. Thanks to the power of plasma's dataengine, all the "getting data code" is shared between those applets anyway. UI-wise, the battery-in-panel is actually a subset of the "battery-extender-on-desktop".

I've also done some performance tweaks to the runner (also in kdebase) that lets you control power management aspects. As we still haven't implemented an easy way to find out about krunner syntax (I usually check the source code :/), here's a quick list of things krunner + powerdevil now understand:

  • screen brightness 80 to set the brightness of your display (between 0 and 100)
  • suspend for various suspend methods
  • power profile to switch to a different profile
  • power governor for a list of CPU governors
  • power scheme for different schemes (note to self: find out what the difference between scheme and profile is ;-))
  • screen brightness (without number) to turn off and dim the screen
We should probably collect this knowledge on UserBase ...

In other power management news, we've also come quite far. Various people (among them Lubos) have done an awesome job making KDE suck less power. I've done some tests over the last months. Around KDE 4.0, the machine caused 700 - 900 wakeups per second, idle. Most of that (but not all) was caused by an issue in xine when using certain functions in phonon. Right now, we're pretty much there. My idle system is down to around 100 wakeups per second, most of that caused by hardware (wifi, usb, sata, ...). Something the kernel developers are working on. KDE (plasma + apps) accounts for 5 wakeups a second, the first KDE app comes in as 10th. To put those numbers in perspective: 100 wakeups per second is already pretty low. Everything below it is probably highly optimized. Even in compositing mode, when you're not moving your windows KWin doesn't suck extra power. Good news for mobile KDE users. :)

[ Fri, 26 Sep 2008 04:04:04 +0200 ] permanent link

This weblog does currently not offer the option to comment. I would be happy to receive an email with your thoughts.

Weblog Archive

23-11-2007, 18:44 h
© Sebastian Kügler
[Parsetime: 0.0379sec]