etc-gentoo/hprofile/profiles/power/ptest

18 lines
247 B
Plaintext
Raw Normal View History

2015-07-31 00:34:53 +00:00
#
# power/ptest
#
2015-07-31 00:34:53 +00:00
local state="$(echo /sys/class/power_supply/A*)"
2015-07-31 00:34:53 +00:00
if test -n "$state" -a -r "$state"; then
state=$(< "$state")
case "$state" in
(1) echo "adp";;
(0) echo "bat";;
esac
fi
2015-07-31 00:34:53 +00:00
#
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
#