summaryrefslogtreecommitdiff
path: root/battery
blob: 29189ae8f5094f1d3470a8edecdba2f12611252a (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh
report=$(acpi | tr -d ',')
echo $report | grep -qv Unknown
if [ "$?" = "0" ]; then
    status=$(echo $report | cut -d\  -f 3 | cut -b 1)
    perc=$(echo $report | cut -d\  -f 4)
    time=$(echo $report | cut -d\  -f 5 | sed 's/\([0-9]*\):\([0-9]*\).*/\1h\2m/')
    echo $status$perc $time
fi