Created
June 11, 2011 13:38
-
-
Save cmavr8/1020553 to your computer and use it in GitHub Desktop.
Laptop power saving - for a Lenovo X201s running Ubuntu 11.04
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
#!/bin/bash | |
rfkill block bluetooth | |
iwconfig wlan0 power on | |
iwconfig wlan0 txpower 30mW | |
iwconfig wlan0 power timeout 500ms | |
killall dropbox | |
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy | |
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | |
echo 1 > /sys/module/snd_hda_intel/parameters/power_save | |
if [[ $1 == "max" ]] | |
then | |
echo "Max power saving settings" | |
##Networking down: | |
service network-manager stop | |
/etc/init.d/networking stop | |
modprobe -r iwlagn bnep btusb | |
killall nm-applet | |
fi | |
if [[ $1 == "restore" ]] | |
then | |
echo "Restoring Medium power saving settings" | |
service network-manager start | |
/etc/init.d/networking start | |
sudo modprobe iwlagn | |
sudo modprobe bnep | |
sudo modprobe btusb | |
nm-applet & | |
dropbox start & | |
fi | |
powertop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: run the script as root when you are on battery (bluetooth gets disabled).
For max battery life run it with the option "max" (networking gets disabled).
To restore normal operation run it with option restore.