Ora

How do I disable screen in Linux?

Published in Display Management 4 mins read

You can disable your screen in Linux using various command-line utilities like xset (for X Window System environments), vbetool, or through desktop environment power management settings, effectively turning off the display.

Turning off your monitor in Linux can be useful for saving power, privacy, or to simply step away from your computer without logging out. The method you use often depends on whether you are running an X Window System (graphical desktop environment) or a command-line interface.

Methods to Disable Your Screen in Linux

1. Using xset for X Window System Environments

The xset command is a powerful utility for configuring X Window System preferences, including display power management. It allows you to immediately turn off your monitor.

To disable your screen instantly:

xset dpms force off

Key Points about xset:

  • Immediate Effect: As a result of this command, the monitor should turn off immediately.
  • Multiple Monitors: Notably, xset can't precisely select a monitor to turn off in a multiple-monitor scenario. It turns off all the attached monitors.
  • Other States: Similarly, we can use the xset command to put the monitor in different states. Besides forcing off, you can use standby or suspend:
    • xset dpms force standby
    • xset dpms force suspend

To re-enable the display after using xset dpms force off, simply move your mouse or press any key on your keyboard.

2. Utilizing vbetool for Console or Legacy Systems

For environments without an active X server, or on some older hardware, vbetool can be used to control video card power states.

To turn off the screen using vbetool:

sudo vbetool dpms off

Note: vbetool often requires sudo privileges because it interacts directly with hardware.

To turn it back on:

sudo vbetool dpms on

3. Leveraging Display Power Management Signaling (DPMS)

DPMS is a standard for power management of computer monitors. Most modern Linux systems and desktop environments integrate with DPMS to automatically turn off screens after a period of inactivity.

You can check the current DPMS status with:

xset -q | grep -A 2 "DPMS (Display Power Management Signaling):"

This will show if DPMS is enabled and the configured standby, suspend, and off times.

To enable DPMS (if it's disabled for some reason):

xset +dpms

To set the inactivity times for standby, suspend, and off (in seconds):

xset dpms 600 900 1200

(Here, the screen will go to standby after 600 seconds (10 minutes), suspend after 900 seconds (15 minutes), and turn completely off after 1200 seconds (20 minutes).)

4. Through Desktop Environment Settings

Modern desktop environments like GNOME, KDE Plasma, XFCE, and MATE provide graphical interfaces to manage power settings, including when the screen should turn off. This is often the most user-friendly way to manage screen power and ensure settings are persistent across reboots.

  • GNOME: Navigate to Settings > Power or Settings > Privacy > Screen Lock. You can set the "Blank Screen" or "Turn Off Screen" duration.
  • KDE Plasma: Go to System Settings > Power Management > Energy Saving. Here you can configure when the screen enters power-saving modes.
  • XFCE: Find Settings Manager > Power Manager.
  • MATE: Look for Control Center > Power Management.

5. Physical Monitor Buttons

The simplest method, often overlooked, is to use the physical power button on your monitor itself. This directly cuts power to the display, regardless of your operating system. Some monitors also have dedicated input source buttons that can effectively "disable" the display by switching to an unused input.

Summary of Commands for Screen Control

Purpose Command Environment Notes
Turn screen off (X) xset dpms force off X Window System Turns off all connected monitors.
Standby screen (X) xset dpms force standby X Window System Puts monitor in low-power standby mode.
Suspend screen (X) xset dpms force suspend X Window System Puts monitor in deeper suspend mode.
Turn screen off (Console) sudo vbetool dpms off Console/Legacy May require sudo privileges.
Re-enable screen (X) Move mouse / Press key X Window System
Re-enable screen (Console) sudo vbetool dpms on Console/Legacy May require sudo privileges.
Enable DPMS xset +dpms X Window System Ensures automatic power saving is active.
Set DPMS inactivity times xset dpms [standby] [suspend] [off] X Window System Values are in seconds.

Choosing the right method depends on your specific Linux environment and what you intend to achieve. For most desktop users, the xset command or desktop environment settings are the most practical solutions.