i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Bluetooth block UPower fallback

Open LovingMelody opened this issue 6 years ago • 7 comments

Some devices do not report the battery via bluez; for these devices getting power from UPower should be a good alternative.

LovingMelody avatar Nov 06 '19 06:11 LovingMelody

I wrote a quick fix for this, adding upower_device to the Bluetooth config block in my fork Edit: Patch doesn't self update, unsure on how to fix it.

LovingMelody avatar Nov 06 '19 07:11 LovingMelody

I'm not sure I really understand this. Will UPower always have battery information, even if it is not available through bluez? I was not aware that there was any interaction between the two.

atheriel avatar Nov 06 '19 21:11 atheriel

No, won’t always have it, but the vast majority of my devices aren’t reported through bluez but are reported in UPower. The only device that I own that is Bluetooth and isn’t reported via UPower is the Apple AirPods.

LovingMelody avatar Nov 07 '19 02:11 LovingMelody

Coming back to this now that I have a BT device which only implements battery via UPower, it does seem pretty handy. Otherwise you need to have two blocks in your config for your device (one bluetooth and one battery).

@Fuzen-py Is your fork still around?

ammgws avatar Dec 22 '21 03:12 ammgws

Hi @ammgws, this would help me with my keyboard bluetooth device, it does report its battery level via Upower.

What should be done to help push this feature forward ?

Device: /org/freedesktop/UPower/devices/battery_hid_dco2co26o3ao64o00_battery
  native-path:          hid-dc:2c:26:3a:64:00-battery
  model:                Keychron K7
  serial:               dc:2c:26:3a:64:00
  power supply:         no
  has history:          yes
  has statistics:       yes
  keyboard
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    percentage:          77%
    icon-name:          'battery-full-symbolic'
  History (charge):
    1696118330	77.000	discharging
    1696118330	0.000	unknown
    1696118300	77.000	discharging
    1696118300	0.000	unknown
    1696118270	77.000	discharging
    1696118270	0.000	unknown
  History (rate):
    1696118330	0.000	unknown
    1696118300	0.000	unknown
    1696118270	0.000	unknown

Maybe we should also add the fact that charging/discharging state should be shown/configurable

@LovingMelody is your fork still usable or your block inside your fork ? is it usable with latest upstream stable i3status rust version ? or you're not using i3status-rust anymore ? and I should give it a try ?

AkechiShiro avatar Oct 01 '23 00:10 AkechiShiro

I am no longer using i3-status I'm using waybar now. Looks like my fork is also gone.

LovingMelody avatar Oct 14 '23 16:10 LovingMelody

it does report its battery level via Upower.

You could try merge_with_next to join bluetooth and battery blocks together.

e.g.

[[block]]
block = "bluetooth"
mac = "F0:BC:F1:E6:57:5F"
merge_with_next = true

[[block]]
block = "battery"
driver = "upower"
device = "ps-controller-battery-f0:bc:f1:e6:57:5f"
missing_format = ""

ammgws avatar Oct 15 '23 09:10 ammgws