Skip to content
/ batalert Public

Send D-Bus notifications when the (Linux) host's battery runs low. Written in Rust.

License

Notifications You must be signed in to change notification settings

0snap/batalert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

batalert

Send D-Bus notifications when the (Linux) host's battery runs low.

License

Prerequisites

  • Install libnotify
  • Install a Notification Server to render desktop notifications
    • Use mako on Wayland/Sway setups

Usage

You can run batalert with default setting to send the first notification when the battery falls below 15% and repeat the notification every 3%. Notifications timeout after 15 seconds. batalert resets when you plug-in your charger.

Customization

  • Check the help text:
    batalert -h
    
  • Show a notification when the battery falls below 20%, repeat notification every 4% on 16%, 12%, 8% ... :
    batalert --alert 20 --notification-step 4
    
  • Timeout notifications after a minute:
    batalert --timeout 60
    
  • Use a custom icon:
    batalert --icon /usr/share/icons/<your-icon>.png
    
  • Monitor a particular battery, e.g., BAT2:
    batalert --uevent /sys/class/power_supply/BAT2/uevent
    
  • Monitor multiple batteries (repeat the --uevent option):
    batalert --uevent /sys/class/power_supply/BAT0/uevent --uevent /path/to/bat1 -u /path/to/bat2
    

Building

Build the app via Cargo:

cargo build --release

About

Send D-Bus notifications when the (Linux) host's battery runs low. Written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages