- #!/bin/bash
- STATUS=`acpi -p | awk '{print $3}' | cut -d, -f1`
- case STATUS in
- charged) echo "battery is fully charged" ;;
- charging) echo "still charging up" ;;
- discharging) echo "discharging" ;;
- if [ "$TATUS" != "discharging" ]; then
- # reset back to normal
- echo 0 > /proc/sys/vm/laptop_mode
- echo 10 > /proc/sys/vm/dirty_ratio
- echo 5 > /proc/sys/vm/dirty_background_ratio
- echo 500 > /proc/sys/vm/dirty_writeback_centisecs
- echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy
- else
- # Turn on aggressive power savings
- echo 5 > /proc/sys/vm/laptop_mode
- echo 40 > /proc/sys/vm/dirty_ratio
- echo 10 > /proc/sys/vm/dirty_background_ratio
- echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
- echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
- fi
Undefined
By: Guest | Date: Dec 26 2009 21:56 | Format: None | Expires: never | Size: 819 B | Hits: 867
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago