Files
nixos/Droidnix/generated/.config/scripts/batterywarn.sh
T
2026-04-19 22:04:11 +02:00

11 lines
345 B
Bash
Executable File

#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
capacity=$(cat /sys/class/power_supply/BAT*/capacity)
status=$(cat /sys/class/power_supply/BAT*/status)
if [ "$status" != "Charging" ] && [ "$capacity" -lt 15 ]; then
echo " $capacity%"
else
echo ""
fi