greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

Battery module does not find /sys/class/power_supply/BAT0/charge_full #96

Closed xdnicoco closed 6 years ago

xdnicoco commented 7 years ago

I get an Error in block 'battery': failed to open file /sys/class/power_supply/BAT0/charge_full when trying to add a battery block. Using arch linux 4.13.7-1-ARCH on lenovo yoga 700. Result of ls -l /sys/class/power_supply/BAT0:


-r--r--r-- 1 root root 4096 Oct 20 10:39 capacity
-r--r--r-- 1 root root 4096 Oct 20 10:39 capacity_level
-r--r--r-- 1 root root 4096 Oct 20 10:39 cycle_count
lrwxrwxrwx 1 root root    0 Oct 20 10:39 device -> ../../../PNP0C0A:00
-r--r--r-- 1 root root 4096 Oct 20 10:39 energy_full
-r--r--r-- 1 root root 4096 Oct 20 10:39 energy_full_design
-r--r--r-- 1 root root 4096 Oct 20 10:39 energy_now
-r--r--r-- 1 root root 4096 Oct 20 10:39 manufacturer
-r--r--r-- 1 root root 4096 Oct 20 10:39 model_name
drwxr-xr-x 2 root root    0 Oct 20 10:39 power
-r--r--r-- 1 root root 4096 Oct 20 10:39 power_now
-r--r--r-- 1 root root 4096 Oct 20 10:39 present
-r--r--r-- 1 root root 4096 Oct 20 10:39 serial_number
-r--r--r-- 1 root root 4096 Oct 20 10:39 status
lrwxrwxrwx 1 root root    0 Oct 20 09:56 subsystem -> ../../../../../../../../../class/power_supply
-r--r--r-- 1 root root 4096 Oct 20 10:39 technology
-r--r--r-- 1 root root 4096 Oct 20 10:39 type
-rw-r--r-- 1 root root 4096 Oct 20 10:39 uevent
-r--r--r-- 1 root root 4096 Oct 20 10:39 voltage_min_design
-r--r--r-- 1 root root 4096 Oct 20 10:39 voltage_now```
greshake commented 7 years ago

see https://github.com/greshake/i3status-rust/issues/16

greshake commented 7 years ago

It should default to capacity, which you have...

atheriel commented 7 years ago

Having the same issue here, too. I have a capacity file but no charge_full file.

Razakhel commented 6 years ago

Still same issue here, charge_full not found:

deepin capture-ecran_zone de selection _20171229104840

$ ls /sys/class/power_supply/BAT0/
alarm     capacity_level  device       energy_full_design  manufacturer  power      present        status     technology  uevent              voltage_now
capacity  cycle_count     energy_full  energy_now          model_name    power_now  serial_number  subsystem  type        voltage_min_design

Using the custom block with the command given in issue #16 works great though.

command = "echo  `cat /sys/class/power_supply/BAT0/capacity`%"
atheriel commented 6 years ago

@Razakhel do you mind me asking what kernel version you are running? I've had this issue on 4.11 but not since.

Razakhel commented 6 years ago

I'm on Arch, so I have the latest possible kernel version I guess. This has been updated yesterday so I don't know what its version was, but as of now I run on 4.14.9-1-ARCH and the bug is still there.

atheriel commented 6 years ago

Ok, I think that this is common and annoying enough that we should modify the logic.

Miniwoffer commented 6 years ago

I had the same problem, but also energy later disepaired and was replaced with charge.