Quantcast
Channel: Active questions tagged desktop-environment - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 118

Automatically disable second display when it is turned off

$
0
0

I have a PC with 2 monitors attached to it. I don't need the second screen all the time, so I quite often turn it off. My problem is, that my desktop environment still thinks it is there: I can move the mouse cursor into the dark void, and sometimes application windows are opening on the black screen. The Display Configuration of my GUI system settings also shows both monitors as active.

How can I tell my desktop environment to automatically disable a monitor, once it is turned off?

(I am on Mint22/Ubuntu 24.04 and Plasma5 (X11, but the behaviour on wayland was no different) as a desktop environment)

UPDATE:

The primary screen is connected with Displayport, the secondary one with HDMI, both on the same discrete graphics adapter.

ddcutil is capable of detecting the power state of the secondary monitor

Both monitors turned on:

$ ddcutil detectDisplay 1   I2C bus:  /dev/i2c-11   DRM connector:           card2-HDMI-A-4   EDID synopsis:      Mfg id:               GSM - Goldstar Company Ltd (LG)      Model:                LG Ultra HD      Product code:         23304  (0x5b08)      Serial number:              Binary serial number: 314700 (0x0004cd4c)      Manufacture year:     2017,  Week: 5   VCP version:         2.1Display 2   I2C bus:  /dev/i2c-13   DRM connector:           card2-DP-4   EDID synopsis:      Mfg id:               BNQ - UNK      Model:                BenQ PD2700U      Product code:         32814  (0x802e)      Serial number:        ET86N02056SL0      Binary serial number: 16843009 (0x01010101)      Manufacture year:     2022,  Week: 25   VCP version:         2.2$ ddcutil getvcp d6 --display 1VCP code 0xd6 (Power mode                    ): DPM: On,  DPMS: Off (sl=0x01)$ ddcutil getvcp d6 --display 2VCP code 0xd6 (Power mode                    ): DPM: On,  DPMS: Off (sl=0x01)

Only one monitor turned on:

$ ddcutil detectInvalid display   I2C bus:  /dev/i2c-11   DRM connector:           card2-HDMI-A-4   EDID synopsis:      Mfg id:               GSM - Goldstar Company Ltd (LG)      Model:                LG Ultra HD      Product code:         23304  (0x5b08)      Serial number:              Binary serial number: 314700 (0x0004cd4c)      Manufacture year:     2017,  Week: 5   DDC communication failedDisplay 1   I2C bus:  /dev/i2c-13   DRM connector:           card2-DP-4   EDID synopsis:      Mfg id:               BNQ - UNK      Model:                BenQ PD2700U      Product code:         32814  (0x802e)      Serial number:        ET86N02056SL0      Binary serial number: 16843009 (0x01010101)      Manufacture year:     2022,  Week: 25   VCP version:         2.2$ ddcutil getvcp d6 --display 1VCP code 0xd6 (Power mode                    ): DPM: On,  DPMS: Off (sl=0x01)mat@roggen:~$ ddcutil getvcp d6 --display 2Display not found

Viewing all articles
Browse latest Browse all 118

Trending Articles