#laptop #battery #power #cli

app batsignal

Batsignal is a lightweight command-line utility designed for seamless integration with scripts, allowing you to automate actions based on your device's battery status

1 unstable release

0.1.0 Feb 15, 2025

#1174 in Command line utilities

MIT license

9KB
168 lines

Batsignal can be used in shell-scripts to wait for certain battery conditions, or to check current battery conditions. See examples below.

Examples

batsignal --wait --state charging && echo "Charger connected!"
batsignal --wait --lt 10 && echo "Battery below 10%!"
batsignal --lt 25 && echo "Battery below 25%!" || echo "Battery okay"

Install

A simple cargo install batsignal should do it.

Dependencies

~2.6–4MB
~72K SLoC