#battery #laptop #power #cli #action #command-line-tool

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

new 0.1.0 Feb 15, 2025

#787 in Command line utilities

Download history 96/week @ 2025-02-11

96 downloads per month

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
~73K SLoC