Comment 14 for bug 213128

Revision history for this message
Luis Alberto Pabón (copong) wrote : Re: [Bug 213128] Re: [Hardy] Guidance-power-manager doesn't know when laptop is mains unplugged
  • unnamed Edit (1.7 KiB, text/html; charset=ISO-8859-1)

Luimama, your hack works for me.

2008/4/24 Louimama <email address hidden>:

> Ok. I did a quick and dirty hack. Now that works on my machine. Of
> course this issue should be resolved in hal, but at least it works. Edit
> /usr/share/python-support/kde-guidance-powermanager/powermanage.py and
> change the function onBattery to look that way
>
> def onBattery(self):
> """ Find out if we're on AC or on battery using HAL. """
> if not self.hasAC:
> print "No AC adapter found - assume that we are on batteries."
> return False
>
> properties =
> self.batteries[0].GetAllProperties(dbus_interface="org.freedesktop.Hal.Device")
> return properties["battery.rechargeable.is_discharging"]
>
>
> Luka, maybe it is possible to combine the two tests, both on the ac_adapter
> and the battery state ?
>
> --
> [Hardy] Guidance-power-manager doesn't know when laptop is mains unplugged
> https://bugs.launchpad.net/bugs/213128
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Luis Pabón