Public paste
power_save
By: microhaxo | Date: Dec 26 2009 19:53 | Format: None | Expires: never | Size: 711 B | Hits: 879

  1. #!/bin/bash
  2. if on_ac_power; then
  3. # Reset back to normal settings
  4.   echo 0 > /proc/sys/vm/laptop_mode
  5.   echo 10 > /proc/sys/vm/dirty_ratio
  6.   echo 5 > /proc/sys/vm/dirty_background_ratio
  7.   echo 500 > /proc/sys/vm/dirty_writeback_centisecs
  8.   echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy
  9. else
  10. # Turn on aggressive power savings
  11.   echo 5 > /proc/sys/vm/laptop_mode
  12.   echo 40 > /proc/sys/vm/dirty_ratio
  13.   echo 10 > /proc/sys/vm/dirty_background_ratio
  14.   echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
  15.   echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
  16. fi
  17.  
  18.  
  19. //// the rc.local was completely empty, so i added this:
  20.  
  21. exec /home/power_save