Skip to content

The Personalized Low Battery Warning System is a Linux shell script that monitors the battery level and provides a personalized low battery warning using text-to-speech and desktop notifications. The script checks the battery status at regular intervals and alerts the user when the battery drops below a specified threshold while discharging.

Notifications You must be signed in to change notification settings

vortex-m/linux-battery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Linux Battery Warning Script

This script monitors the battery level of your Linux device and provides audio and visual notifications when the battery level drops below a specified threshold while discharging.

Features

  • Monitors battery percentage and charging status.
  • Provides audio warning using espeak.
  • Displays a desktop notification using notify-send.
  • Customizable low battery threshold and user name.

Prerequisites

Make sure you have the following installed:

  • acpi: For fetching battery status.
  • espeak: For audio notifications.
  • notify-send: For desktop notifications (usually part of the libnotify package).

You can install these packages using your package manager. For example, on Ubuntu, you can run:

sudo apt install acpi espeak libnotify-bin

Change the battery configration.

LOW_BATTERY_THRESHOLD=20  # Set your desired battery threshold percentage

Usage

  1. Run
   ./low_battery_warning.sh &
  1. Stop
   kill %1
  1. View Background Running
   jobs
  1. Troubleshooting
   upower -i /org/freedesktop/UPower/devices/battery_BAT0

For any query mail.mayank001@gmail.com

About

The Personalized Low Battery Warning System is a Linux shell script that monitors the battery level and provides a personalized low battery warning using text-to-speech and desktop notifications. The script checks the battery status at regular intervals and alerts the user when the battery drops below a specified threshold while discharging.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages