Am Mittwoch, 28. März 2012 schrieb Serghei Amelian:
On Wednesday 28 March 2012 19:43:54 Mag. Dr. Nikolaus
Klepp wrote:
[...]
kpowersave doesn't use acpid, but HAL. Check if your user have
permissions to query hal, via dbus.
I can query hal, but how do I query hal via dbus?
With dbus-send, but I can't tell you exactly how to query it, I'm not
familiar with hal api.
[...]
Ok, found a way. Looks like my user has access to hal via dbus:
$ python
Python 2.7.3rc2 (default, Mar 21 2012, 16:14:45)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license"
for more information.
>> import dbus
>> bus = dbus.SystemBus()
>> hal_manager_obj =
>>
bus.get_object("org.freedesktop.Hal","/org/freedesktop/Hal/Manager")
>> hal_manager = dbus.Interface(hal_manager_obj,
>> "org.freedesktop.Hal.Manager")
>> batPath = hal_manager.FindDeviceByCapability("battery")
>> bat = bus.get_object("org.freedesktop.Hal", batPath[0])
>> bat.GetAllProperties(dbus_interface="org.freedesktop.Hal.Device")
dbus.Dictionary({dbus.String(u'battery.reporting.technology'):
dbus.String(u'Li-ion', variant_level=1), dbus.String(u'info.category'):
dbus.String(u'battery', variant_level=1), dbus.String(u'info.parent'):
dbus.String(u'/org/freedesktop/Hal/devices/computer', variant_level=1),
dbus.String(u'battery.charge_level.last_full'): dbus.Int32(56160,
variant_level=1), dbus.String(u'info.product'): dbus.String(u'92P1127',
variant_level=1), dbus.String(u'battery.charge_level.current'):
dbus.Int32(41210, variant_level=1),
dbus.String(u'battery.rechargeable.is_charging'): dbus.Boolean(False,
variant_level=1), dbus.String(u'linux.subsystem'):
dbus.String(u'power_supply', variant_level=1),
dbus.String(u'battery.voltage.unit'): dbus.String(u'mV',
variant_level=1),
dbus.String(u'battery.charge_level.rate'): dbus.Int32(0, variant_level=1),
dbus.String(u'battery.type'): dbus.String(u'primary', variant_level=1),
dbus.String(u'battery.charge_level.percentage'): dbus.Int32(73,
variant_level=1), dbus.String(u'linux.sysfs_path'):
dbus.String(u'/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0',
variant_level=1), dbus.String(u'battery.charge_level.design'):
dbus.Int32(56160, variant_level=1), dbus.String(u'battery.voltage.design'):
dbus.Int32(10800, variant_level=1), dbus.String(u'battery.is_rechargeable'):
dbus.Boolean(True, variant_level=1),
dbus.String(u'battery.reporting.current'): dbus.Int32(41210,
variant_level=1), dbus.String(u'info.subsystem'):
dbus.String(u'power_supply', variant_level=1),
dbus.String(u'battery.reporting.design'): dbus.Int32(56160,
variant_level=1), dbus.String(u'linux.hotplug_type'): dbus.Int32(2,
variant_level=1), dbus.String(u'battery.model'): dbus.String(u'92P1127',
variant_level=1), dbus.String(u'battery.voltage.current'): dbus.Int32(11310,
variant_level=1), dbus.String(u'battery.remaining_time'): dbus.Int32(6868,
variant_level=1), dbus.String(u'battery.serial'): dbus.String(u'30552',
variant_level=1), dbus.String(u'info.udi'):
dbus.String(u'/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0',
variant_level=1), dbus.String(u'info.capabilities'):
dbus.Array([dbus.String(u'battery')], signature=dbus.Signature('s'),
variant_level=1), dbus.String(u'battery.technology'):
dbus.String(u'lithium-ion', variant_level=1),
dbus.String(u'battery.rechargeable.is_discharging'): dbus.Boolean(True,
variant_level=1), dbus.String(u'battery.reporting.unit'):
dbus.String(u'mWh', variant_level=1), dbus.String(u'battery.present'):
dbus.Boolean(True, variant_level=1),
dbus.String(u'battery.reporting.last_full'): dbus.Int32(56160,
variant_level=1), dbus.String(u'battery.vendor'): dbus.String(u'SANYO',
variant_level=1)}, signature=dbus.Signature('sv'))
>>
So ... what to do next? I installed xfce4-power-manager as a workaround (which
actually works), but that's not quite what I was looking for :-)
nik