Battery Monitor is a Python script designed to monitor your laptop's battery level and trigger an alarm when it falls below a specified threshold. The script logs the battery status and other relevant information to a log file and stops monitoring once the battery is charged beyond a specified limit.
- Monitors battery percentage and triggers an alarm when below a threshold.
- Log battery status, remaining time, and power source to a log file.
- Stops the alarm once the power source is connected or the battery level is above the threshold.
- Configurable battery thresholds, check intervals and log file location.
- Python 3.x
psutil
librarypygame
library
-
Clone the repository:
git clone https://github.com/yourusername/battery-monitor.git
-
Install the required packages:
pip install requirements.txt
-
Ensure the alarm audio file is in the specified path (
./audio/piano-chilled-melody.wav
).
Run the script using Python 3:
python3 battery_monitor.py