Hi
I've been using this script:
Code:
#!/bin/bash
if on_ac_power; then
# Reset back to normal settings
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
echo 0 > /sys/bus/pci/drivers/iwl3945/0000:03:00.0/power_level
hal-disable-polling --enable-polling --device /dev/cdrom
modprobe uhci_hcd
compiz --replace
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
echo 5 > /sys/bus/pci/drivers/iwl3945/0000:03:00.0/power_level
hal-disable-polling --device /dev/cdrom
modprobe -r uhci_hcd
metacity --replace
fi
From this excellent thread: http://ubuntuforums.org/showthread.php?t=729644 for a while now to control certain aspects of power management for me.
The one aspect that's not working though is the window manager replacement commands at the end of each section.
This has a drastic impact on battery life for me so I've been trying to get it working all evening.
I've got a hunch it's because the scripts are being executed as root but I'm not sure.
Does anyone have any ideas how to make it work correctly.
1000 thank yous in advance.
Tom
Bookmarks