juve45 / batstat Goto Github PK
View Code? Open in Web Editor NEWCLI battery status for linux
CLI battery status for linux
Hello,
What license is this code/software available under? If you haven't chosen one, you might find the following resources helpful:
A useful tidbit:
You're under no obligation to choose a license. However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. If you're creating an open source project, we strongly encourage you to include an open source license. The Open Source Guide provides additional guidance on choosing the correct license for your project.
it doesn't work on Centos7.6.1810 because of the different path...
My OS the power path is different from default configure.
$ neofetch --off [16:20:15]
siuoly@arch-x260
----------------
OS: Arch Linux x86_64
Host: 20F5S41F0B ThinkPad X260
Kernel: 6.6.5-arch1-1
Uptime: 1 day, 21 hours, 59 mins
Packages: 721 (pacman)
Shell: zsh 5.9
Resolution: 1366x768, 1920x1080
WM: i3
Theme: Adwaita [GTK3]
Icons: Adwaita [GTK3]
Terminal: xst
CPU: Intel i5-6300U (4) @ 3.000GHz
GPU: Intel Skylake GT2 [HD Graphics 520]
Memory: 3236MiB / 7812MiB
After checking the PATH "/sys/class/power_supply/", I found it is diff to my system. So I change it
// orginal
#define ENERGY "charge"
#define POWER "voltage"
// new
#define ENERGY "energy"
#define POWER "power"
it working.
It's simplest tool to record the battery history!!
My battery data is at /sys/class/power_supply/BAT0
, but I only see this:
Status: Discharging
Max energy: 0.00 Wh
Energy left: 0.00 Wh
Power Consumption: 0.00 W
Percentage left: -nan%
Average power Consumption: 0.00 W
Time elapsed: 0: 0: 9 since -nan%
= Time ======== Percent ============================================
0: 0: 0 -nan%
Average power consumption should have it's units in Watts, not Watt-Hours, as Wh is a unit measuring both power and time (and thus is suitable as the unit for Total power consumption, but not an Average)
~/batstat$ sudo make install
install -m 775 batstat /usr/local/bin
install: cannot perform `stat' on 'batstat': No such file or directory
make: *** [Makefile:21: install] Error 1
this method or this one don't work either
how to install (preferably ubuntu 22.04)? thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.