i3 / i3/i3status

Battery capacity stuck at 100% if "last_full_capacity = true"

Open
#169 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
653
Forks
254
PR merge metrics
No merged PRs in 30d

Description

**This is a copy of the [issue](https://github.com/i3/i3/issues/2512) I wrongly filed in i3/i3 repository:**

Output of `i3 --moreversion 2>&- || i3 --version`:

```
Binary i3 version: 4.12 (2016-03-06, branch "4.12") © 2009 Michael Stapelberg and contributors
Running i3 version: 4.12 (2016-03-06, branch "4.12") (pid 865)
Loaded i3 config: /home/mochobb/.i3/config (Last modified: sex 07 out 2016 18:16:35 WEST, 1293372 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
```

URL to a logfile as per http://i3wm.org/docs/debugging.html:

[logs.i3wm.org/logs/5651442522128384.bz2](logs.i3wm.org/logs/5651442522128384.bz2)
[i3bar.bar-0.log.txt](https://github.com/i3/i3/files/546006/i3bar.bar-0.log.txt)

**What I did:**

I changed i3status.conf to indicate the correct "uevent" path and set `last_full_capacity = true`

My current i3status.conf battery block:

```
battery 0 {
# format = "%status %percentage %remaining %emptytime"
format = " %status %percentage %remaining "
format_down = " no battery "
last_full_capacity = false
integer_battery_capacity = true
hide_seconds = true
# status_chr = ""
status_chr = "⚡"
# status_bat = ""
# status_bat = "bat"
status_bat = "☉"
# status_full = ""
status_full = "☻"
low_threshold = 10
threshold_type = percentage
path = "/sys/class/power_supply/C11F/uevent"
}
```

My current "uvent" file:

```
POWER_SUPPLY_NAME=C11F
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000
POWER_SUPPLY_VOLTAGE_NOW=16293000
POWER_SUPPLY_CURRENT_NOW=0
POWER_SUPPLY_CHARGE_FULL_DESIGN=1698000
POWER_SUPPLY_CHARGE_FULL=1698000
POWER_SUPPLY_CHARGE_NOW=1698000
POWER_SUPPLY_CAPACITY=100
POWER_SUPPLY_CAPACITY_LEVEL=Full
POWER_SUPPLY_MODEL_NAME=Primary
POWER_SUPPLY_MANUFACTURER= Hewlett-Packard
POWER_SUPPLY_SERIAL_NUMBER=00 CC 10 A2 00 64 30 00
```

**What I saw:**

The battery current capacity is always shown as 100%, irrespective of the value directly got from the "uevent" file. This doesn't happen if I set `last_full_capacity = false`.

EDIT: if i3status.conf is edited setting `last_full_capacity = true` and i3 reloaded, this behaviour isn't visible. It only happens if one logs out and back in or after rebooting. Setting `last_full_capacity = false` consistently results in correct behaviour across reboots.

**What I expected instead:**

I expect the current capacity to be updated as the battery looses it's capacity when the power cord is unplugged. The correct behaviour occurs if I set `last_full_capacity = false`.

Thank you very much for taking the time to read this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.