My notebook has an HDMI connection to external monitor. I want have xrandr to pass parameters so that the image is displayed on both internal and external monitors, and when the external monitor is disconnected, the image continues to be displayed on the internal.

Currently I turn it off it manually:

xrandr --output LVDS1 --off --output HDMI1 --auto

And turn on:

xrandr --output LVDS1 --auto --output HDMI1 --auto

So I want to put xrandr command with correct parameters in $HOME/.xinitrc, so that video would go out on both monitors.

  • 1
    man xrandr, read up on --same-as.
    – dirkt
    Oct 20, 2017 at 6:35
  • @dirkt, thanks for pointing this option, but does --same-as go along with --output option? Can you give example?
    – Mark
    Oct 21, 2017 at 1:19
  • 3
    Possible duplicate of xrandr clone monitor autodetect resolution Apr 28, 2018 at 19:42
  • I'd say it is not a duplicate. The linked question is about setting the second display to a video mode with the same screen pixel area, but this is not required in this question.
    – njsg
    Apr 29, 2018 at 21:14
  • @Mark, it is a "per-output" option, so it must come after an --output option. So xrandr --output HDMI1 --same-as LVDS1 to make HDMI1 show the same as LVDS1.
    – njsg
    Apr 29, 2018 at 23:57


You must log in to answer this question.

Browse other questions tagged .