Custom script: set cpu governor to powersave

Custom script to set cpu governor to powersave when using battery, and return to ondemand when plugged


cat /etc/pm/power.d/90khad
#!/bin/sh

batt() {

echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo powersave > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo powersave > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo powersave > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

}

ac() {

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

}

case $1 in
    true) batt ;;
    false) ac ;;
    *) exit $NA ;;
esac

exit 0


Comments

Popular posts from this blog

Tips Jika Mobil Anda Habis Bensin LOL!

Setting open office u label tom & jerry