So... I have two monitors on my Ubuntu machine. And every time I launch some Windows OpenGL application under Wine it turns off the second monitor. And leaves it turned off when the application exits. I wonder, is there a shell command which will instantly turn the second monitor on?

  • 1
    Try the xrandr command? – Graeme Apr 15 '14 at 13:13
  • Any concrete samples? – Aleksandr Kravets Apr 15 '14 at 14:02
  • Depends a lot on what you have/what you want. I use this on my laptop - xrandr --output HDMI1 --auto --same-as LVDS1. You can have --left-of, --right-of etc. – Graeme Apr 15 '14 at 14:06
  • Ok, I'l try to read man – Aleksandr Kravets Apr 15 '14 at 14:07
  • @Graeme you can answer question,and I will accept your answer. I read man page and created a link on my desktop which does what I want. – Aleksandr Kravets Apr 15 '14 at 14:16
up vote 9 down vote accepted

The xrandr command is the one you are looking for. An example usage is:

xrandr --output HDMI1 --auto --same-as LVDS1

You can have --left-of, --right-of. Run xrandr on its own to see the different outputs that are available.

  • I'll add that to find out names of outputs one can run xrandr --current – Aleksandr Kravets Apr 15 '14 at 15:07
  • @AleksandrKravets, shouldn't be any different than xrandr on its own in most cases. The man page says that this avoids looking for any hardware changes, so I would avoid this unless I have a specific reason to use it. – Graeme Apr 15 '14 at 15:12
  • You're right, I just didn't try it that way :) – Aleksandr Kravets Apr 15 '14 at 15:19

Use xrandr command without args for view your output names and the supported resolutions.

Once you have this informations, you can setup a screen like this (this is an example, there is a lot of others options):

**xrandr --output <output> --mode <resolution> --right-of/--left-of <output>**

You can also just reactivate your screen with:

**xrandr --output <output> --auto**
  • 1
    Sorry, there's no such thing as --on option. But there's --auto. – Aleksandr Kravets Apr 15 '14 at 14:14

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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