Easy configuration of dual monitor?

9,770

Thanks. Jacob's solution is just what I was looking for.

<screen> is meant to replace the specific input that you need to provide to xrandr. To find out what that name of the input is, look at the first acronym that appears just before the list of numbers when you run xrandr. In my case these were LVDS1 and VGA1 (the first is my laptop, the second my external monitor).

In case anyone is interested, here are the four commands that I used for the four items I added to a panel's launcher:

xrandr --output VGA1 --auto --rotate left --left-of LVDS1 (This rotates my monitor in portrait mode, keeping it to the left of my laptop's monitor)

xrandr --output VGA1 --auto --rotate normal --left-of LVDS1 (This rotates my external monitor horizontally, say because I want to watch a video. It also keeps it to the left of my monitor).

xrandr --output LVDS1 --auto --right-of VGA1 (This turns on my laptop monitor, placing it to the right of my external monitor)

xrandr --output LVDS1 --off (This turns off my laptop monitor)

Share:
9,770

Related videos on Youtube

SaMeji
Author by

SaMeji

Updated on September 18, 2022

Comments

  • SaMeji
    SaMeji over 1 year

    I recently bought an external monitor which I use in Portrait mode attached to my laptop. With quite some regularity I have to connect/disconnect it monitor (I work at home and often need to move to another room).

    But this means that every time that I have to connect/disconnect it, I have to reset it with the display manager. And that means doing quite a number of clicks and wait a few annoying seconds between each click.: first to activate the external monitor, then to rotate it 90 degrees, and then to place it on the left of the monitor (or to turn the laptop off).

    Is there a way that I can expedite this, either by having the display manager remember some of my configurations or by writing a command script that I can just invoke and which will set up up my monitor in one single command/click?

    I am using Xubuntu, so please let me know if this response is exclusive to this distribution (I suspect that it is not).

    Thanks in advance.

    Santiago.

    • Jacob Vlijm
      Jacob Vlijm about 9 years
      That is very well possible, You can simply create a command and add it to a key combination, or run a tiny background script keeping an eye on wether the screen is attached or not. Do you know the screen's name? (it is in the output of xrandr)?
    • Jacob Vlijm
      Jacob Vlijm about 9 years
      See the dupe to create the command...
  • Jacob Vlijm
    Jacob Vlijm about 9 years
    Seems like a huge detour, since the command to rotate the second screen is one very short line: xrandr --output <screen> --rotate left. Put it under a key and you're done.
  • funkybananna82
    funkybananna82 about 9 years
    It's the same thing. Just with a GUI.
  • SaMeji
    SaMeji about 9 years
    Thanks. The second alternative is just what I was looking for. However, I am not sure how to know how to find out the name of my screen that I need to pass to xrandr (i.e. I don't know what to write instead of <screen>)
  • SaMeji
    SaMeji about 9 years
    OK.... Found it.
  • Yogee
    Yogee almost 4 years
    just for everyone's help, "xrandr --listmonitors" command will tell you names of your monitors.