aboutsummaryrefslogtreecommitdiff
path: root/battery-status
blob: c30b2c50b8820279609eafb30b714885ce941bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Send battery information to stdout

# Get battery status
battery="/sys/class/power_supply/BAT0"
message=""

if [ -d $battery ]; then
	capacity=$(cat $battery/capacity)
	status=$(cat $battery/status)
	message="$capacity% $status"
else
	message="No battery"
fi

echo "$message"

Generated with cgit - Back to sebastiano.tronto.net