1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

case $1 in
    pre) /usr/bin/powersave false ;;
    post)       
	if cat /sys/class/power_supply/AC0/online | grep 0 > /dev/null 2>&1
	then
    		/usr/bin/powersave true	
	else
    		/usr/bin/powersave false
	fi
    ;;
esac'
exit 0