Page 1 of 3

MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 5:57 pm
by madmax25
In the lower right corner of my screen, I can see the battery level of my laptop, but if I connect my BT headphones I don't know the according battery level until they stop working.

Is there any way to add that information right to where the ordinary battery level is being displayed or perhaps even add it to Conky, please?

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 7:57 pm
by Stevo
Apparently we need to edit the configuration file /etc/bluetooth/main.conf and change the line

Code: Select all

# Experimental = false
to

Code: Select all

Experimental = true
save the file.

I'm running systemd with MX KDE, so I restarted bluetooth with

Code: Select all

systemctl restart bluetooth
(try rebooting if this does not work), reconnected my device, and now its charge level shows in the little Bluetooth taskbar widget when I hover over it.

Let me know if this works on XFCE! You can see it also in the terminal now with the command:

Code: Select all

bluetoothctl info
Mine has the battery % on the last line:

Code: Select all

Device 41:42:05:8A:82:B3 (public)
        Name: F6
        Alias: F6
        Class: 0x00240404
        Icon: audio-headset
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        Battery Percentage: 0x28 (40)
So Conky should be able to use that value with the right magic code to scrape the value.
st

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 8:30 pm
by madmax25
Sorry, it doesn't seem to work.
I already tried that guide, which led me to my question here.

In the bluetoothctl info, I didn't find any line referring to the wanted battery percentage value,
but I will try it once more, to be sure I didn't miss anything on my first attempt (now, after your post, I actually know what to look for).

I will report back afterwards, asap ...

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 8:40 pm
by Stevo
I have heard that some headphones use a nonstandard method to communicate, but I'm using some cheapo BT earbuds. I also have some other cheapos, like several sets of headbands/sleep masks with headphones built in, that one can pick up for a few bucks on AliExpress...yeah, this one works too:

Code: Select all

Device 41:42:53:0E:DE:4F (public)
        Name: BT-Music
        Alias: BT-Music
        Class: 0x00240404
        Icon: audio-headset
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        Battery Percentage: 0x64 (100)

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 10:52 pm
by dolphin_oracle
edit* worked OK after a reboot/reconnect

Code: Select all


┌─[dolphin@mx23kde]─[10:53:47 pm]────────────────────────────────────────────────────────────────────────────────[/]
└─> bluetoothctl info
Device AC:12:2F:DB:15:EC (public)
        Name: Soundcore Life Q30
        Alias: Soundcore Life Q30
        Class: 0x00240404
        Icon: audio-headset
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (66666666-6666-6666-6666-666666666666)
        Battery Percentage: 0x5a (90)

**edit***

ah, the usually battery monitor in KDE picks it up right off, if you left click to bring out the expanded battery info. Haven't tried Xfce yet, but even if it doesn't, you could probably make a genmon plugin with a custom bluetoothctl info command work to display a percentage.

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 10:59 pm
by Stevo
dolphin_oracle wrote: Sun Sep 29, 2024 10:52 pm edit* worked OK after a reboot/reconnect


CLI stuff

[/code]
Does it show up on the xfce taskbar BT widget like the Plasma one if you hover the cursor over it?

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 11:04 pm
by dolphin_oracle
it shows in the Xfce power manager when you left click to get the expanded battery info, just like in KDE.

so easy peasy really.

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 11:10 pm
by timkb4cq
Not hovering on the panel widget. If you open Bluetooth Devices and hover over the symbols to the right of a connected device it does show up.
I'm not convinced it's always a real reading since it doesn't seem to change. It was 90 just after removing from the charger, and is still at 90 after listening for half an hour. Of course this is an $8 set of headphones from Ollie's Outlet.

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Sun Sep 29, 2024 11:37 pm
by dolphin_oracle
Image

view from the Xfce4 power manager panel plugin

Re: MX 23.4 xfce - battery lavel indicator for Bt headphones wanted

Posted: Mon Sep 30, 2024 1:54 am
by m_pav
Works perfectly on Xfce, no restart needed, just stopped and restarted BT service. This is with my lower mid range Sennheiser HD540 BT Headset (all I could afford) which I use to fix up bad voice recordings.

Blueman Battery icon now shows when connected
Image

Right click and select info in blueman does not show battery info.
Image

Xfce Tray Power Icon shows it
Image