Skip to content

2IMT/battery-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

battery-notifier

CLI tool that notifies you when your battery is low.

Table of contents

Usage

Just start it and let it run in background:

battery-notifier

Configuration

battery-notifier is configured using environment variables.

The following environment variables are used:

  • BN_BATTERY_PATH - Path to the battery device directory
    • Default: /sys/class/power_supply/BAT0
  • BN_ADAPTER_PATH - Path to the power adapter device directory
    • Default: /sys/class/power_supply/AC0
  • BN_THRESHOLD - Battery level threshold
    • Default: 15
  • BN_PERIOD_SECS - Period of battery state polling in seconds
    • Default: 30
  • BN_NOTIFY_COMMAND - Command to execute when battery level is below the threshold
    • Default: notify-send "The battery is low" "Please connect the charger"

Build

Note: Arch-based distro users may skip to Installation (Arch-based distros) section

Dependencies

  • C compiler
  • Make

Building

make

Installation

Note: this may require root privileges.

make install

This will install the binary to /usr/local/bin if the INSTALL_PREFIX environment variable is not set. Set the INSTALL_PREFIX environment variable to change the installation directory.

Installation (Arch-based distros)

Use this AUR package

About

CLI tool that notifies you when your battery is low

Resources

License

Stars

Watchers

Forks