With the release of
Ubuntu 10.04 "Lucid Lynx", the OS ships the kernel module
eeepc_laptop by default. What is different from the previous Ubuntu release is that the Super Hybrid Engine is now fully supported by the kernel.
The Super Hybrid Engine allows the user to throttle down CPU and fans when less computing power and more battery life is required. Activating the power saving mode gives about an hour additional battery life on my Asus EEEPC 1000HE.
Until Lucid Lynx, Ubuntu users where forced to install alternative kernels and scripts to throttle down both CPU and fans. Now it is possible to let the hardware take control of the parameters and just tell the kernel which power mode is preferred. I put together a script which sets this parameter:
#!/bin/bash
if [ "$1" == "powersave" ] ; then
TARGET='powersave'
elif [ "$1" == "performance" ] ; then
TARGET='performance'
elif (grep -q 'discharging' /proc/acpi/battery/BAT0/state); then
TARGET='powersave'
else
TARGET='performance'
fi
if [ "$TARGET" == "powersave" ]; then
echo 2 > /sys/devices/platform/eeepc/cpufv
echo 0 > /sys/devices/platform/eeepc/camera
echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "enabled 2 (powersave)" >> /tmp/log
STATUS='powersave'
else
echo 0 > /sys/devices/platform/eeepc/cpufv
echo 1 > /sys/devices/platform/eeepc/camera
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "enabled 0 (performance)" >> /tmp/log
STATUS='performance'
fi
sleep 1
export DISPLAY=:0 && notify-send -t 1000 "Super Hybrid Engine" $STATUS This script shuts down the webcam and sets the SHE parameter to "powersave" when it detects that the computer is running on battery. It activates the webcam and sets the SHE parameter to "high performance" otherwise. You will notice that the fans slow down in powersave mode, too. If you don't want to disable the webcam, remove the lines which I marked with "# *".
Copy the script to
/etc/acpi/my-eeepc-battery.sh and make it executable. Create a second file,
/etc/acpi/events/my-eeepc-battery containing the following two lines:
event=battery
action=/etc/acpi/my-eeepc-battery.sh
Now run
sudo service acpi restart and be happy with your energy savings!
If you want to control the script manually, you can allow your user run the script by running
sudo visudo and adding the following line to the file (Insert your username instead of "daniel", of course!):
daniel ALL= NOPASSWD: /etc/acpi/my-eeepc-battery.sh Now you can create shortcuts on your desktop or panel for the following commands:
sudo /etc/acpi/my-eeepc-battery.sh powersave
sudo /etc/acpi/my-eeepc-battery.sh performance
You are doing all this on your own risk and if you mess something up... well... get help :-)