October 10th 2021
Batsignal
Batsignal is a lightweight battery daemon written in C that notifies the user about battery states. It makes use of lib-notify to send notifications of battery levels
Because you clicked on this
If you clicked on this purely because you wanted to know your device’s battery level. Here is what you are most likely looking for:
cat /sys/class/power_supply/BAT0/capacity
Thank me later. Oh, and yes, I would argue searching in /dev/BAT0
would have been logical aswell but I guess its not there :shrug:
Installation
On arch based systems
yay -S batsignal
Next you want to create a systemd service to auto-start the service when the device is booted. Create the following file under /usr/lib/systemd/system/batsignal.service
[Unit]
Description=Lightweight battery daemon
[Service]
ExecStart=/usr/bin/batsignal -f 90 -w 20 -c 10 -d 3
[Install]
WantedBy=multi-user.target
After this it should be as simple as
systemctl enable --now batsignal
!Luc