summaryrefslogtreecommitdiff
path: root/etc/functions/check_ac
blob: d97d7daaaa1cd0ef851c9b5a6105247c0c07161f (plain)
1
2
3
4
5
6
7
8
## vim:ft=zsh
## check_ac - returns true if machine is running on AC
typeset file=/sys/class/power_supply/AC/online
if [[ -f $file ]] {
	[[ $(cat $file) == 1 ]]
	return $?
}
return 0