You are not logged in.
I'm on a Macbook 2,1 running Arch and just recently noticed that my conky started showing 2 billion % for my battery's charge. Conky simply uses:
${battery_percent BAT0}%
In any case, I've manually dug around as well in /sys/class/power_supply before to figure things out and in doing so found:
]$ ls /sys/class/power_supply/BAT0
alarm energy_now present type
cycle_count manufacturer serial_number uevent
device model_name status voltage_min_design
energy_full power subsystem voltage_now
energy_full_design power_now technology
$ cat /sys/class/power_supply/BAT0/energy_full
0
$ cat /sys/class/power_supply/BAT0/energy_now
0
$ cat /sys/class/power_supply/BAT0/power_now
0
$ cat /sys/class/power_supply/BAT0/present
1
$ cat /sys/class/power_supply/BAT0/status
Discharging
$ cat /sys/class/power_supply/BAT0/voltage_now
0
These use to contain non-zero values such that (energy_now/energy_full)=% charge.
Any suggestions on how to figure out what happened?
Last edited by jwhendy (2012-01-18 04:49:57)
Offline
Could you try using this instead?
${battery BAT0}
And do you have acpid installed? Conky still needs something to handle the ACPI events.
Last edited by Manit0u (2012-01-17 11:59:22)
Offline
@ManitOu:
-- Using ${battery BAT0) gives me [charging], so it must be looking at /sys/class/power_supply/status.
-- I didn't have acpid installed. I don't consider the battery an "event," but could be wrong. My read of the wiki is that acpid handles buttons and lid events and the like. This is simply looking for how much battery power I have. I installed acpid and started the daemon. There doesn't seem to be a change in /sys/class files or in conky's output. Do I need to restart after adding it to rc.conf for it to take effect?
Offline
Strange. This ended up being fixed by a reboot from Arch into OS X (I dual boot) and back to Arch. I'll mark this solved here but posted on SuperUser to try and find out the root cause in a more populous setting.
Offline
You should try and deplete your battery some and then see what it looks like.
In my case ${battery BAT0} shows charged when full and when not it shows "charging 97%" for example (it checks both status and current level in %). That's why I wanted it to try it with this command instead.
Anyway, I'm glad you solved the issue.
Offline
Ah. I can try that now that it's "reset." The other night when I did that, I just got the state, which makes sense: sys/class/power_supply/BAT0/status was "Discharging" but the percent was still not present, so perhaps that's why I only saw the state.
I'm guessing that now that it's better, I'd get what you did: "discharging xx%"
Thanks for the feedback.
Offline
You can also combo this display.
I'm using:
$acpiacadapter
${battery BAT1} ${battery_time BAT1}
battery_time doesn't come up when your battery is fully charged, otherwise it shows you time left to discharge (with adapter unplugged) or charge back up to full capacity (with adapter plugged in).
Here's the result when I unplug the adapter:
Offline