2

When an external monitor is connected, xrandr shows me two displays: eDP1 (laptop screen) and DP1 (external monitor).

I can enable the external monitor just fine, but if I unplug the external monitor, or disable it with xrandr --output DP1 --off, the laptop screen goes blank too (though still backlit). I believe I can still switch to a tty on the laptop screen.

Any ideas how to keep my laptop screen running after disabling/disconnecting the external monitor?

If it matters, I'm using i3.

  • 1
    What do you mean by "I'm using i3" -- what is "i3"? – Elias Oct 4 '19 at 10:51
0

I'm not using i3 windowing manager but what could be happening here is external monitor is the primary monitor and laptop display mirrors it. Either way create this bash script:

#!/bin/bash
xrandr --output DP1 --off
xrandr --output eDP1 --auto --primary

Mark the script as executable: chmod a+x /path/to/scriptname

Then call the script with /path/to/scriptname

Replace eDP1 with your laptop monitor name discovered using:

xrandr | grep " connected"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.