cnx: Could not load battery status file

The docs state that cnx reads battery info from /sys/class/power_supply/BAT0/ but my device doesn’t seem to have this directory. Instead a /sys/class/power_supply/BAT1/ directory exists with all the battery info. So when I use: cnx_add_widget!(cnx, Battery::new(&cnx, attr.clone(), Color::red())); an error is thrown:

Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Could not load value from battery status file: charge_full

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (1 by maintainers)

Most upvoted comments

I have added Linux implementation back here: https://github.com/mjkillough/cnx/pull/37

The MR still needs some cleaning, I will merge this once I find some spare time.

@72siddharth I have updated the MR. Can you give that a try ?

@72siddharth Thanks, yeah I’m looking to see if there a better way to solve this. Can you open a new issue for the volume widget problem ?

You mean it didn’t show the volume before ?

Yea, that’s what I meant. Now the volume widget shows up but doesn’t update.

@72siddharth I just merged the MR to master. Are you able to reproduce the issue with master branch ?