Batnotify
Low battery notifier bash script and systemd service
Install / Use
/learn @arindas/BatnotifyREADME
batnotify
Notification script and systemd timer for triggering low battery notifications.
How it works
We query battery state and charge percentage by reading from:
/sys/class/power_supply/BAT0/status/sys/class/power_supply/BAT0/capacity
If the battery state is "discharging" and the current charge percentage is less than the
specified ${SAFE_BATTERY_LEVEL}, we trigger a notification using notify-send
Now we run the script using a systemd service file. In order to repeatedly check the status, we run a systemd timer for the corresponding service file.
Installation
# clone the repo
git clone git@github.com:arindas/batnotify.git
cd batnotify/
# install the relevant files
cp ./batnotify ~/.local/bin
cp ./batnotify.service ~/.config/systemd/user
cp ./batnotify.timer ~/.config/systemd/user
# enable and start the systemd service timer
systemctl --user enable batnotify.timer
systemctl --user start batnotify.timer
Uninstallation
# disable and stop the systemd service timer
systemctl --user disable batnotify.timer
systemctl --user stop batnotify.timer
See also
poweralertd: Also handles power notifications for different wireless devices, in addition to main system power.
Related Skills
node-connect
348.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
