bin/battery @ 87ff0514c83b
More
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Wed, 27 Aug 2025 16:17:11 -0400 |
parents | 2e41ef790dc8 |
children | (none) |
#!/usr/bin/env bash set -euo pipefail function check_battery { # TODO make this less shit BATT="$1" echo "$BATT" cat "$BATT"/type if test -e "$BATT"/online; then echo -n "Online: " cat "$BATT"/online fi if test -e "$BATT"/capacity; then echo -n "Capacity (%): " cat "$BATT"/capacity fi echo } for b in /sys/class/power_supply/*; do check_battery "$b" done