This project is a simple command-line tool that displays battery status information on Unix-like systems. The tool specifically shows battery status, charge level, health, and whether the battery is plugged in or unplugged.
- Display battery capacity and charge level
- Show battery status (plugged in or unplugged)
- Display battery type and health
- Show tool version
- Verbose mode to display detailed battery information
This tool is designed to run only on Unix-like systems (such as Linux and macOS). For proper functionality, the relevant battery information files must exist in the /sys/class/power_supply/BAT0/
path on your system.
- First, download or copy the code.
- Ensure you have the
g++
compiler or any other C++ compiler installed on your system.
In the project directory, there is a Makefile
. To compile the project, use the following command:
make
This will generate the executable battery_monitor
in the current directory.
To run the tool after compiling:
./batputer
-h
or--help
: Display help message.-v
or--version
: Show the tool version.-vv
or--verbose
: Show detailed battery information.
- To display the battery status by default:
./batputer
- To show the version of the program:
./batputer --version
- To display more detailed battery information (verbose mode):
./batputer --verbose
- To display the help message:
./batputer --help
main.cpp
: The main program file containing the code that runs the tool.tinyArgs/include/tinyArgs.hpp
: Header file for thetinyArgs
library to handle command-line arguments.Makefile
: Makefile that helps you compile the project using themake
tool.
- Version: 0.0.2
- Developer: mateo-rfz