linuxmint / slick-greeter

A slick-looking LightDM greeter
GNU General Public License v3.0
365 stars 59 forks source link

only shows status of one battery #134

Open unhammer opened 5 years ago

unhammer commented 5 years ago
 * slick-greeter version (slick-greeter --version)
slick-greeter 1.2.2
 * Distribution - (Mint 17.2, Arch, Fedora 25, etc...)
Xubuntu 18.10
 * Graphics hardware *and* driver used
$ sudo lshw  -c video
  *-display                 
       description: VGA compatible controller
       product: HD Graphics 620
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 02
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:124 memory:e0000000-e0ffffff memory:d0000000-dfffffff ioport:e000(size=64) memory:c0000-dffff

(Thinkpad X270)

 * 32 or 64 bit
64-bit

Issue Battery indicator only shows status of one battery.

Steps to reproduce

  1. have two batteries
  2. wait until one is at 5% and the other is at 99%
  3. see slick-greeter show 5% instead of something more reasonable

Expected behaviour something like

$ calc "$(awk '{s+=$0}END{print s}' /sys/class/power_supply/*/energy_now) / $(awk '{s+=$0}END{print s}' /sys/class/power_supply/*/energy_full)"
    ~0.45474137931034482759

ie. sum of energy left divided by sum of energy full would be more reasonable

Vahan86 commented 4 years ago

@unhammer, is this still an issue with slick-greeter 1.3.2?

unhammer commented 4 years ago

Is there a .deb of that? (tried 1.3.0 but no difference there)

unhammer commented 3 years ago

I'm on

ii  slick-greeter  1.3.2+dfsg.1-1 amd64        Slick-looking LightDM greeter

and it's still an issue, yes. I see 5% from slick-greeter and 24% from xfce's panel plugin.

unhammer commented 3 years ago

same deal when I try upgrading the debs to

ii  slick-greeter  1.4.1+dfsg.1-1ubuntu1 amd64        Slick-looking LightDM greeter

or

ii  slick-greeter  1.5.1-1ubuntu1 amd64        Slick-looking LightDM greeter

so it's still there in e.g. ubuntu impish

unhammer commented 3 years ago

Relevant lines seem to be

https://github.com/linuxmint/slick-greeter/blob/dcbb38af4d3f4276889f958b883c962bb8957fa6/src/menubar.vala#L270..L274

https://github.com/linuxmint/slick-greeter/blob/dcbb38af4d3f4276889f958b883c962bb8957fa6/src/menubar.vala#L300..L301

https://github.com/linuxmint/slick-greeter/blob/dcbb38af4d3f4276889f958b883c962bb8957fa6/src/menubar.vala#L315

update_power should probably return a number so the for-loop can sum (may have to move the asyncness if that doesn't allow returning? I don't speak vala)

doremiyeon commented 1 year ago

alternatively, maybe simply using /org/freedesktop/UPower/devices/DisplayDevice could fix this issue. see https://upower.freedesktop.org/docs/UPower.html