Artix Linux Forum

Artix Linux => System => Topic started by: Wolzly on 23 February 2024, 02:32:10

Title: New keychron Q5 pro keyboard. Looking for a way to query the battery level.
Post by: Wolzly on 23 February 2024, 02:32:10
I've been scouring the internet for an answer and maybe I'm just bad at it but I've found nothing to answer my question so far.

I just bought the Q5 Pro keyboard from Keychron and right now I've got it operating wirelessly in 2.4gz mode.  Anyone know if there's a way to query battery level from within the os?  There's a key combo you can hit and the keyboard lights up leds to indicate it's level so I'm not without options but I like having battery levels for devices built into waybar.

Of course I could just switch the thing to bluetooth mode and then I'm assuming I'd have a battery indicator available through upower but I was just wondering if anyone here has experience with this?  Or if someone much smarter and/or experienced than me knows where I could be looking to track down info on this device.
Title: Re: New keychron Q5 pro keyboard. Looking for a way to query the battery level.
Post by: andyscott on 25 February 2024, 18:29:48
upower is the only non-GUI method I know. GNOME power manager et. al might be able to report battery level too, but as far as I know they're just front ends for upower in this respect.
Title: Re: New keychron Q5 pro keyboard. Looking for a way to query the battery level.
Post by: Arghya77 on 07 December 2024, 09:10:19
I recently got the new Keychron Q5 Pro keyboard and I'm loving the build quality and typing experience so far! However, (https://watsapp.gold/) I'm trying to figure out how to query the battery level. Is there a built-in way to check the battery status directly on the keyboard or through software? Would appreciate any tips or suggestions from others who have used it! Thanks!
Title: Re: New keychron Q5 pro keyboard. Looking for a way to query the battery level.
Post by: clappingsnowdrop on 09 December 2024, 21:38:23
I'm using a wireless mouse, so I'm not sure if it'll work the same for both of you.

Notes:
The <number> could be any number assigned by the system. Usually starting with 0

I've used this to query the mouse battery percentage.

First see if you can go to:
Code: [Select]
/sys/class/power_supply/hidpp_battery_<number>/

From there check the files named with model_name and capacity.
The model_name verifies that this device in this directory/folder is indeed for the keyboard.
capacity for the battery percentage.

If you can't find anything (such as the directory) then try these commands: (I don't recommend these for a status script(such as for status bars) it's gonna be slow/bloated.)

for finding the keyboard: (The first line reported should be the name of the device, second line being the directory it is at.)
Code: [Select]
find /sys -type f -iname 'model_name' -exec cat {} \; -execdir pwd \; 2> /dev/null

if the output does say that it's from Keychron Q5/wireless keyboard
then:

Go to the directory: (If you have more than 1 wireless device this command may not work. You will have to go to it manually.)
Code: [Select]
cd $(find /sys -type f -iname 'model_name' -execdir pwd \; 2> /dev/null)

From there there should be a file named model_name and capacity.
Title: Re: New keychron Q5 pro keyboard. Looking for a way to query the battery level.
Post by: Artist on 09 December 2024, 22:40:45
I also use Keychron keyboard and afaik its battery status does not get exposed to Linux.
Just charge it at the 1st day of each month; that should do. ;)

artist
Title: Re: New keychron Q5 pro keyboard. Looking for a way to query the battery level.
Post by: Wolzly on 10 December 2024, 04:57:19
I recently got the new Keychron Q5 Pro keyboard and I'm loving the build quality and typing experience so far! However, (https://watsapp.gold/) I'm trying to figure out how to query the battery level. Is there a built-in way to check the battery status directly on the keyboard or through software? Would appreciate any tips or suggestions from others who have used it! Thanks!

You can get a nice (interesting?) onboard battery query by hitting Fn+b.  This will illuminate the number keys, it will illuminate 1 through 0 (all 10 of them) if the thing is at 100%, and only 1 through 5 (5 of them) for 50%, etc.

Yeah I'm very happy I returned the logitech thing I bought and ordered one of these.

*Although* one thing I can complain about is the (maybe I'm wrong) inability to disable the numlock & capslock backlight indicator.  Or if that is disableable and I just gave up to quickly, I can at least complain the that indicator backlight pulses off and then on after a second seemingly randomly.