Commit Graph

1 Commits

Author SHA1 Message Date
Stefano Mazzucco 388186cc28 Use /org/freedesktop/UPower/devices/DisplayDevice as self.device
DisplayDevice is a "special" device object that represent what a widget should
display, however it does *not* give information about Line Power. E.g. when a
laptop has no battery but is plugged on the mains, DisplayDevice says that no
device should be displayed and the icon is set to "battery-missing" (which is
in fact true).

However, if we are working, it means that we must be getting power from
somewhere, so let's display something in the tooltip anyway.

Command line example

$ upower -i /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         no
  updated:              Sun 05 Nov 2017 04:19:48 PM GMT (415 seconds ago)
  has history:          no
  has statistics:       no
  unknown
    warning-level:       none
    icon-name:          'battery-missing-symbolic'

See also https://upower.freedesktop.org/docs/UPower.html#UPower.GetDisplayDevice
2017-11-05 16:51:31 +00:00