tmux-plugins / tmux-battery

Plug and play battery percentage and icon indicator for Tmux.
MIT License
503 stars 98 forks source link

add support for UPower version 0.99.4 #30

Closed edouard-lopez closed 7 years ago

edouard-lopez commented 8 years ago

A quick solution, need to ensure there is no regression as I don't know the format of the grep remain case.

upower output for reference:

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               LGC
  model:                00HW002
  serial:               2598
  power supply:         yes
  updated:              Tue 06 Sep 2016 04:14:53 PM CEST (12 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              44,67 Wh
    energy-empty:        0 Wh
    energy-full:         46,97 Wh
    energy-full-design:  50,22 Wh
    energy-rate:         12,546 W
    voltage:             16,728 V
    time to empty:       3,6 hours  # <--------------------------------------------
    percentage:          95%
    capacity:            93,2099%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (charge):
    1473171293  95,000  discharging
  History (rate):
    1473171293  12,546  discharging
martinbeentjes commented 8 years ago

Looks good to me, I prefer to see an example for both the remain and the time to empty case which this enhancement will work for both cases.

edouard-lopez commented 7 years ago

closing as base code evolded.