Code Monkey home page Code Monkey logo

Comments (4)

coldfix avatar coldfix commented on May 30, 2024

Hi, thanks for the report,

can you show the output of

ls -la /sys/class/power_supply/

you may need to change the value of the adapter variable to the constructor accordingly.

and

ls -la /sys/class/power_supply/BAT*/

If there is nothing, do you have acpi installed? What OS are you running?

from battery-widget.

 avatar commented on May 30, 2024

ls -la /sys/class/power_supply output:

total 0
drwxr-xr-x  2 root root 0 Jul 25 18:20 .
drwxr-xr-x 54 root root 0 Jul 25 18:20 ..
lrwxrwxrwx  1 root root 0 Jul 25 20:41 ACAD -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:01/ACPI0003:00/power_supply/ACAD
lrwxrwxrwx  1 root root 0 Jul 25 20:41 BAT1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:01/PNP0C0A:00/power_supply/BAT1

ls -la /sys/class/power_supply/BAT*/ output:

total 0
drwxr-xr-x 3 root root    0 Jul 25 18:20 .
drwxr-xr-x 3 root root    0 Jul 25 18:20 ..
-rw-r--r-- 1 root root 4096 Jul 25 20:45 alarm
-r--r--r-- 1 root root 4096 Jul 25 20:45 capacity
-r--r--r-- 1 root root 4096 Jul 25 20:45 capacity_level
-r--r--r-- 1 root root 4096 Jul 25 20:45 charge_full
-r--r--r-- 1 root root 4096 Jul 25 20:45 charge_full_design
-r--r--r-- 1 root root 4096 Jul 25 20:45 charge_now
-r--r--r-- 1 root root 4096 Jul 25 20:45 current_now
-r--r--r-- 1 root root 4096 Jul 25 20:45 cycle_count
lrwxrwxrwx 1 root root    0 Jul 25 20:45 device -> ../../../PNP0C0A:00
-r--r--r-- 1 root root 4096 Jul 25 20:45 manufacturer
-r--r--r-- 1 root root 4096 Jul 25 20:45 model_name
drwxr-xr-x 2 root root    0 Jul 25 20:45 power
-r--r--r-- 1 root root 4096 Jul 25 20:45 present
-r--r--r-- 1 root root 4096 Jul 25 20:45 serial_number
-r--r--r-- 1 root root 4096 Jul 25 20:45 status
lrwxrwxrwx 1 root root    0 Jul 25 20:45 subsystem -> ../../../../../../../../class/power_supply
-r--r--r-- 1 root root 4096 Jul 25 20:45 technology
-r--r--r-- 1 root root 4096 Jul 25 20:45 type
-rw-r--r-- 1 root root 4096 Jul 25 18:20 uevent
-r--r--r-- 1 root root 4096 Jul 25 20:45 voltage_min_design
-r--r--r-- 1 root root 4096 Jul 25 20:45 voltage_now

I did not have installed acpi so I did it, however the error is still the same

my OS : 4.11.9-1-ARCH (Arch Linux)

Thanks for your help

from battery-widget.

coldfix avatar coldfix commented on May 30, 2024

Try using "BAT1" as adapter:

battery = battery_widget({adapter = "BAT1"})

Does it solve the problem?

from battery-widget.

 avatar commented on May 30, 2024

Yes ! It solved ! Thank you for your help !

from battery-widget.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.