How do I tell Unity to mirror my display, using the command line?

I find it awkward, slow, and cumbersome, when giving a presentation, to:

  1. Plug in the video cable to my laptop
  2. Open System Settings
  3. Find the Display Icon
  4. Select the "Mirror Displays" checkbox
  5. Click Apply
  6. Wait a second and then confirm the settings

Instead, I would like to just run a command or write a script that mirrors my primary display and applies in an "I'm feeling lucky" manner.

I've looked at xrandr, but haven't found anything promising...

1 Answer

The option with xrandr for mirroring displays is --same-as. What you will need to configure as well is the resolutions. I have a laptop and a VGA external monitor. Doing xrandr --output VGA-0 --same-as LVDS mirrored the displays, but because VGA output is larger in resolution than laptop screen , the laptop screen got stretched too much. In other words, you may need to configure them to match in resolution. For instance, this answer on unix.stackexchange.com shows example:

xrandr --output HDMI1 --mode 1920x1080 --output LSVD1 --mode 1600x900 --same-as HDMI1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like