summaryrefslogtreecommitdiff
path: root/scripts/misc/battery.sh
blob: 6d192372b53537a5618740b3226f2e7aadaf5d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

#print battery info in a short way

if uname -o | grep -qi "linux"
then
    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