D
D
Dmitry Slipchenko2017-09-12 01:08:25
linux
Dmitry Slipchenko, 2017-09-12 01:08:25

Linux Mint does not see (does not respond to) disconnecting an external monitor, how to fix it?

Hello.
The essence of the problem:
A monitor is connected to the laptop via HDMI. Everything works perfectly.
But when you disconnect HDMI from the laptop - Mint still thinks that the monitor is connected. That is, you can continue to pull windows and programs on the "ghost" monitor.
How do I get the OS to detect that the external monitor is disabled and behave normally?
There seems to be no such thing in the settings of the system itself. Well, I didn't look there.
Thanks in advance.
Laptop: Lenovo (Intel and Nvidia video, but runs on Nvidia)
OS: Linux Mint 18.2 Sonya

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ingvar, 2017-09-12
@slipdem

look towards xrandr:

#!/bin/bash

IN="LVDS1"
EXT="HDMI-0"

if (xrandr | grep "$EXT disconnected"); then
    xrandr --output $IN --auto --output $EXT --off 
else
    xrandr --output $IN --auto --primary --output $EXT --auto --right-of $IN
fi

This is a script. You can also try with one command in the console:
For this to happen on shutdown itself, you need to look towards udev --> example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question