summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/misc/battery.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/misc/battery.sh b/scripts/misc/battery.sh
index c3e5e48..6d19237 100755
--- a/scripts/misc/battery.sh
+++ b/scripts/misc/battery.sh
@@ -4,8 +4,13 @@
if uname -o | grep -qi "linux"
then
- acpi -b | cut -d"," -f 1-2 | cut -d" " -f 3-
-else
- echo "TODO BSD battery"
- exit 1
+ acpi -b | cut -d"," -f 1-2 | cut -d" " -f 3-
+else
+ if uname -o | grep -qi "netbsd"
+ then
+ envstat -d acpibat0 | grep charge: | cut -w -f 3-3
+ else
+ echo "TODO $(uname -o) battery"
+ exit 1
+ fi
fi