Skip to content

Battery warning or alert program for Linux users written in bash

License

Notifications You must be signed in to change notification settings

asapdotid/battery-alert-linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battery Alert for Linux

Full & Low battery alert program for Linux users written in bash. Desktop notification when battery full or falls below a threshold percentage of your choice.

Just a friendly reminder to charge your battery, which might get low if you don't give it a boost. We've all been there, where your laptop dies and you have to find a charger, reboot, and restart all your programs. It's a hassle, i know!

Reference:

ArchWiki - Desktop Notification [doc](Desktop Notification)

Requirement Package

  • Desktop notifications wiki
  • Notify-send (Libnotify) wiki
  • Paplay - PulseAudio wiki
  • Pw-play - Pipewire docs
  • eSpeak wiki

Installing and Updating

Install & Update Script

To install or update battrey alert, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command:

curl -o- https://raw.githubusercontent.com/asapdotid/battery-alert-linux/refs/heads/main/install.sh | bash
wget -qO- https://raw.githubusercontent.com/asapdotid/battery-alert-linux/refs/heads/main/install.sh | bash

Additional Notes

  • If the environment variable $XDG_DATA_HOME or $XDG_CONFIG_HOME is present, it will place the battrey alert files there.

  • The installer can use git, curl, or wget to download battrey alert, whichever is available.

Custom Variables for Alert

Optional of customize default variables:

Variable Default Description
ALERT_SOUND true Alert with sound or espeak (true/false)
ALERT_FULL true Alert for full battery (true/false)
ALERT_EMPTY true Alert for empty battery (true/false)
ALERT_EMPTY_TRHESHOLD 30 Empty trheshold for empty battery (%)

Default config /home/$USER/.local/share/battery-alert/default.conf

# default variables, optional for customize
ALERT_SOUND=true
ALERT_FULL=true
ALERT_EMPTY=true
ALERT_EMPTY_TRHESHOLD=30

Check Battery Alert service & timer

A timer will run the service every 2 minutes

systemctl --user list-timers

To Do

[ ] Custom set timer

If any issue please contact me @asapdotid 😃

@asapdotid