How to switch off a screen laptop under Linux
December 23, 2005 on 8:00 am | In Linux | Add a commentIn this article how to minimise power consumption on a laptop running Linux by switching off the backlight on the screen. This will help save energy as well as reducing the amount of time the fan needs to run. The instructions have been tested on a Dell Latitude C810 running Ubuntu Linux 5.10.
The first part was easy to achieve. It simply required setting the correct governor for the CPU frequency with the following command.
echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Under Breezy, this is executed at run-level 2 from /etc/rc2.d/S30freq-scaling.
It took a bit more work to get the second result. Out of the box, Breezy does very good power management, but some problems still exist due to the inevitable incompatibility of Linux with some laptops.
The first problem with mine was that ACPI events, such as activation of the lid button, were not reported by the kernel. To fix this, an additional option had to be passed to the kernel at boot time by modifying GRUB’s menu.lst as follows.
title Ubuntu, kernel 2.6.12-9-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.12-9-686 root=/dev/hda1 acpi_irq_balance ro quiet splash resume=/dev/hda5
initrd /boot/initrd.img-2.6.12-9-686
savedefault
boot
The second problem seems to be related to the NVIDIA Linux driver that prevents the screen from switching off with xset dpms force off. The solution is to use _vbetool_, which is marked as causing un-expected behaviour in the “man” pages. Nevertheless, I tried it with the Dell Latitude C810 and found it to work fine.
I created the following script to turn the screen on or off. (This actually controls the backlight and does not just blank/unblank the screen.)
#!/bin/sh
case "$1" in
on)
/usr/sbin/vbetool dpms on
;;
off)
/usr/sbin/vbetool dpms off
;;
*)
N=/etc/acpi/screen.sh
echo "Usage: $N {on|off}"
;;
esac
Using this script, after Linux boots, the screen can be switched off by issuing the following command.
/etc/acpi/screen.sh off
Alternatively, screen de-activation can be automated by including this command in an appropriate run-level. The same script can also be used to improve the built-in ACPI-related scripts, for example, for suspend, sleep or hibernate power-saving.
laptop linuxRelated Posts:
- Ubuntu Linux on iBook G3 laptop
- Linux will not displace Windows so soon
- Linux vs Mac OS X: Mac OS X wins
- Boot Camp for Mac OS X on Intel-based Macs
Powered by blog.mu with Pool theme design by Borja Fernandez.

