1. Overview

Controlling display power states is useful for saving energy. This is significantly important when we have limited power source devices like laptops.

Ubuntu offers several command-line tools for manipulating display settings, including turning off the monitor.

In this tutorial, we’ll see multiple ways to turn off a connected monitor directly from the Linux command line.

Specifically, we’ll discuss using vbetool, xset, and xrandr tools to turn a monitor on or off in Ubuntu 22.04. However, these techniques should also work on other Linux systems with no or little adjustments.

2. Turning Off Monitor From Command Line

Monitors are part of many systems, even when the systems don’t have a dedicated graphical interface. Knowing how to switch them off can be important for many reasons:

  • proximity to monitor, e.g., long cables, remote or wireless screens
  • troubleshooting
  • automation

The Linux command line has several options for toggling monitor power states without a graphical user interface (GUI). Of course, this is particularly helpful when there are multiple monitors connected to our system.

For example, instead of going to each monitor, we can directly turn it off from our system. This can be useful specifically when presenting.

Let’s see how to use different command-line tools to turn off the monitor.

3. Using vbetool

Basically, vbetool is a user-space process that attempts to reinitialize the graphics drivers (recover video state) during a system resume.

Moreover, vbetool runs code from the video BIOS using LRMI (Low-level Real Mode Interface).

Let’s install vbetool using apt:

$ sudo apt install vbetool

vbetool can be practically useful for managing screen-related activities. For example, the vbetool command can turn off the screen using DPMS:

$ sudo vbetool dpms off

Display Power Management Signaling (DPMS) enables monitors to save power by activating energy-saving features when the computer is idle.

Similarly, to turn back the monitor on, we use the on option:

$ sudo vbetool dpms on

vbetool requires root or sudo access for handling the monitor state.

Notably, vbetool may exhibit a strange behavior. According to the man page of vbetool, switching DPMS modes may interact badly with X on some systems. Also, due to the use of DPMS, monitor selection isn’t possible with vbetool.

4. Using xset

The xset command is another utility that provides several controls for monitors using an X display. It’s part of the xorg-xset package. Again, it uses the DPMS option to control the display power.

Let’s use xset to turn off a monitor using the force flag:

$ xset dpms force off

As a result, the monitor should turn off immediately. Notably, xset can’t precisely select a monitor to turn off in a multiple-monitor scenario. It turns off all the attached monitors.

Also, we can turn on a monitor again with the on option:

$ xset dpms force on

Similarly, we can use the xset command to put the monitor in different states.

For example, to use the standby mode, we can use the standby option:

$ xset dpms force standby

Besides toggling monitor states, xset can also control keyboard LEDs, mouse parameters, and others.

Now, let’s turn to a method that can selectively pick a specific monitor to turn off.

5. Using xrandr

The xrandr command is a part of the RandR (Resize and Rotate) toolset. It can configure screen resolutions, rotation, and other similar options.

Furthermore, we can list the active monitors with xrandr using the –listmonitors option:

$ xrandr --listmonitors
Monitors: 2
 0: +*HDMI-1-1 1920/597x1080/336+0+0  HDMI-1-1
 1: +eDP-1-1 1920/344x1080/193+0+0  eDP-1-1

Let’s disable the display HDMI-1-1:

$ xrandr --output HDMI-1-1 --off

The above command uses the –output to select a monitor to control. Further, the –off option sets off the monitor’s output.

Similarly, to bring back the monitor, we can use the auto option:

$ xrandr --output HDMI-1 --auto

There are also graphical options available for xrandr. These include ARandR, LXRandR, and others.

6. Conclusion

In this article, we’ve seen different methods to turn off the monitor from the Linux command line.

To summarize, we first used the vbetool which reinitializes the graphics drivers. Then, we used the xset tool to control the monitor state.

Both vbetool and xset use the DPMS standard to control the monitor power. Notably, to take advantage of DPMS, both the monitor and the video card must be compatible with the DPMS standard.

Finally, we used the xrandr tool. This tool is particularly simple to use. Also, it can control multiple monitors at once.

Comments are closed on this article!