SimplePowerSave

This script assists with Powertop for quick managing of system powersaving

Put it to /etc/pm/power.d/ as /etc/pm/power.d/power

 # Shell script to reduce energy consumption when running battery. Place
 # it in /etc/pm/power.d/ and give execution rights.

 if on_ac_power; then

 # Start AC powered settings --------------------------------------------#


 # Disable laptop mode
 echo 0 > /proc/sys/vm/laptop_mode

 #NMI watchdog should be turned on
 for foo in /proc/sys/kernel/nmi_watchdog;
 do echo 1 > $foo;
 done

 # Set SATA channel: max performance
 for foo in /sys/class/scsi_host/host*/link_power_management_policy;
 do echo max_performance > $foo;
 done

 # CPU Governor: Performance
 for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
 do echo performance > $foo;
 done 

 # Disable USB autosuspend
 for foo in /sys/bus/usb/devices/*/power/level;
 do echo on > $foo;
 done

 # Disable PCI autosuspend
 for foo in /sys/bus/pci/devices/*/power/control;
 do echo on > $foo;
 done

 # Disabile audio_card power saving
 echo 0 > /sys/module/snd_hda_intel/parameters/power_save_controller
 echo 0 > /sys/module/snd_hda_intel/parameters/power_save

 # End AC powered settings ----------------------------------------------#

 else

 # Start battery powered settings ---------------------------------------#

 # Enable Laptop-Mode disk writing
 echo 5 > /proc/sys/vm/laptop_mode

 #NMI watchdog should be turned on
 for foo in /proc/sys/kernel/nmi_watchdog;
 do echo 0 > $foo;
 done

 # Set SATA channel to power saving
 for foo in /sys/class/scsi_host/host*/link_power_management_policy;
 do echo min_power > $foo;
 done

 # Select Ondemand CPU Governor
 for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
 do echo ondemand > $foo;
 done

 # Activate USB autosuspend
 for foo in /sys/bus/usb/devices/*/power/level;
 do echo auto > $foo;
 done

 # Activate PCI autosuspend
 for foo in /sys/bus/pci/devices/*/power/control;
 do echo auto > $foo;
 done

 # Activate audio card power saving
 # (sounds shorter than 5 seconds will not be played)
 echo 5 > /sys/module/snd_hda_intel/parameters/power_save
 echo 1 > /sys/module/snd_hda_intel/parameters/power_save_controller

 # End battery powered settings -----------------------------------------#

 fi

Make it executable:

chmod +x /etc/pm/power.d/power

Now when you Unplugged, Powertop suggestion will take over and maximize the battery life & you Plugged in AC power you will have Max Performance.