How to disable the screen (Linux without X)

Solution 1:

You can turn off the screen on your laptop using the xset command:

xset dpms force off

DPMS is Display Power Management Signaling, a standard to reduce power consumption in monitors. xset is of course an X utility. If you need to accomplish this without X involved, use setterm:

setterm -powerdown 1

The full list of options to manipulate your screen:

xset -dpms          # Disable DPMS
xset +dpms          # Enable DPMS
xset s off          # Disable screen blanking
xset s 150          # Blank the screen after 150 seconds
xset dpms 300 600 900       # Set standby, suspend, & off times (in seconds)
xset dpms force standby     # Immediately go into standby mode
xset dpms force suspend     # Immediately go into suspend mode
xset dpms force off     # Immediately turn off the monitor
xset -q             # Query current settings

setterm -blank 10           # Blank the screen in 10 minutes
setterm -powersave on       # Put the monitor into VESA power saving mode
setterm -powerdown 20       # Set the VESA powerdown to 20 minutes

These are all duly explained in the Battery Powered Linux Mini-HOWTO.

Solution 2:

Check out vbetool. You can turn off the screen with:

vbetool dpms off

The only problem I'm having with this is that the screen doesn't turn back on automatically on e.g. keyboard input. You have to do it manually by typing it in blindly or via SSH:

vbetool dpms on

On Debian Squeeze, vbetool is used in /etc/acpi/lid.sh when X is not available.

Solution 3:

I'm not sure which package provides it, but some ACPI-related package includes scripts for blanking the screen based on whether the laptop's lid is open. Although now that I look at the script itself (/etc/acpi/lid.sh), it seems to only work on X. However, the point is that it provides a framework for triggering actions on lid open/close events. You could modify the script to use setterm, and it might do what you want.

Solution 4:

In Kali GNU/Linux Rolling 64-bit check if xset -q shows like this:

DPMS (Energy Star):
Standby: 600 Suspend: 600 Off: 600

Setting all of them to 0 works for me. Do it with this command line:

xset dpms 0 0 0