Created
August 10, 2011 14:06
-
-
Save szastupov/1136871 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ac_power() { | |
echo 0 > /sys/devices/system/cpu/sched_mc_power_savings | |
echo 0 > /proc/sys/vm/laptop_mode | |
hdparm -B 128 -S 240 /dev/sda | |
echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy | |
echo max_performance > /sys/class/scsi_host/host1/link_power_management_policy | |
echo 1 > /sys/module/snd_hda_intel/parameters/power_save | |
} | |
battery_power() { | |
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings | |
echo 5 > /proc/sys/vm/laptop_mode | |
hdparm -B 1 -S 12 /dev/sda | |
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy | |
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy | |
echo 10 > /sys/module/snd_hda_intel/parameters/power_save | |
} | |
case "$1" in | |
false) ac_power ;; | |
true) battery_power ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment