You are not logged in.

#1 2014-07-26 19:22:25

billows
Member
Registered: 2014-07-26
Posts: 8

[SOLVED]Laptop battery not numbered; can't display info using i3status

I am trying to configure i3status to correctly read information about my battery. It is trying to get information about battery 0, however the battery in this laptop is not BAT0 but BAT.

Question: How can I either enable i3status to read from this battery or make it so the battery has a number? I've tried editing the 0 from
order += "battery 0"
but that just generates an error.

Thanks in advance!

Last edited by billows (2014-07-27 20:33:07)

Offline

#2 2014-07-26 20:21:08

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: [SOLVED]Laptop battery not numbered; can't display info using i3status

Welcome to Arch Linux

What laptop is it?
What are the output of dmesg | grep BAT
and of uname -a   ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-07-26 21:23:28

billows
Member
Registered: 2014-07-26
Posts: 8

Re: [SOLVED]Laptop battery not numbered; can't display info using i3status

Thanks for the welcome

I suppose that would have been highly relevant information.

Laptop: Pangolin Performance (system76) model panp8

$ dmesg | grep BAT
[  5.615734] ACPI: Battery Slot [BAT] (battery present)

$ uname -a
Linux arch76 3.15.5-2-ARCH #1 SMP PREEMPT Fri Jul 11 07:56:02 CEST 2014 x86_64 GNU/Linux

Offline

#4 2014-07-27 00:53:35

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: [SOLVED]Laptop battery not numbered; can't display info using i3status

Well, I've been poking around, and I don't have any good answers as yet.  I would point out that you could use conky or one of the other i3status replacement options.  I am looking into the battery naming in acpi.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2014-07-27 02:43:01

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Laptop battery not numbered; can't display info using i3status

Just a heads up, I might be way off with this. Is there is a '/sys/class/power_supply/BAT/uevent'? I3status seems to look for /sys/class/power_supply/BAT%d/uevent, where %d is apparently replaced with the value from the configuration file. You could just edit that one line in i3status.c to whatever your battery path uses. Or better yet, the path should be also parsed from the configuration file, the parameter seems to be simply 'path', so adding that to the default 'battery 0' section might solve the issue.

battery 0 {
        format = "%status %percentage %remaining"
        path = "/sys/class/power_supply/BAT/uevent"
}

I however never used i3status before and do not have any means of testing this right now.

Offline

#6 2014-07-27 18:07:27

billows
Member
Registered: 2014-07-26
Posts: 8

Re: [SOLVED]Laptop battery not numbered; can't display info using i3status

Good call, emeres! That solution (adding path = "..") worked perfectly. The path '/sys/class/power_supply/BAT/uevent' indeed does exist and provides the right information.

ewaller, just for reference here is what running acpi gives

$ acpi
Battery 0: Full, 100%

so it seems like acpi still calls it battery 0, even though the rest of the system doesn't respect that naming convention.

Thank you both.

Offline

Board footer

Powered by FluxBB