You are not logged in.

#1 2016-04-07 14:22:00

Pouletic
Member
Registered: 2015-10-25
Posts: 18

Tip: Setting up dual monitors

This is to help others that are trying to set up a dual (or multi) monitor configuration and are looking for a little help.

Setting up multimonitor

The tool for this is called xrandr (it stands for X resize and rotation), and there's a gui under Menu-->Preferences-->Display called ArandR screen layout editor. You can fiddle around with that to add screens etc.

You can save the resulting configuration through the gui, and reload it. If you want it to be permanent you can add the relevant part of the configuration file to your autostart file (Menu-->Preferences-->Openbox-->Edit autostart). The default save directory for the ArandR screen layout editor configuration is called ~/.screenlayout, so look in there to see what your config file looks like.

I have one flatpanel that only takes the old VGA input and, to the right of it, a newer full HD panel that only accepts HDMI. My configuration file looks like this
#!/bin/sh
xrandr --output VGA-0 --mode 1280x1024 --pos 0x0 --rotate normal --output DVI-0 --off --output HDMI-0 --mode 1920x1080 --pos 1280x0 --rotate normal

You will take just the second line of your configuration (that starts with xrandr) and add it to your autostart file and save it (adding an & to the end of the line first is probably a good idea).

Mismatched resolution

Now, there were still a few problems with my setup. Notably, because my left panel has lower resolution than my right panel, there was a dead space below it that windows were occupying and as a result part of them was not displayed on the screen. You can tell X to scale what it draws to fit a different physical resolution. The simplest way is with the --scale-from option. My final configuration line added to autostart looks like this:

xrandr --output VGA-0 --mode 1280x1024 --pos 0x0 --rotate normal --scale-from 1350x1080 --output DVI-0 --off --output HDMI-0 --mode 1920x1080 --primary --right-of VGA-0 --rotate normal &

To scale the 1024 vertical resolution of my small VGA panel to the 1080 vertical resolution of my HDMI panel, it has to be multiplied by a factor of 1080/1024 = 1.0546, which when applied to the horizontal resolution of the VGA panel (1280) gives a scaled dimension (1.0546*1280) of 1350. Hence, the --scale-from 1350x1080 option. This means that both displays have the same aparent vertical size to the window manager, and moving the mouse (or windows) across at the bottom of one brings it onto the bottom of the other.

I also changed the location of the HDMI panel to --right-of VGA-0, which automatically positions it to adjoin the right side of the VGA panel, whatever its resolution may be. Finally, i added the --primary option to the HDMI panel to identify it as the main display, but this is known to have little effect these days.

I'm sure there are even better ways to do this but i thought it might be useful to others to post this simple description.

Mod edit: Moved from GUI & Applications

Last edited by damo (2016-04-07 15:44:59)

Offline

#2 2016-04-07 18:45:53

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Tip: Setting up dual monitors

Nice guide, thanks for this!
smile


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2016-04-09 18:04:33

jalexander9
Member
Registered: 2015-11-08
Posts: 152

Re: Tip: Setting up dual monitors

@ Pouletic - Wow, what a well written post!

Your suggestion for using the [--scale-from] option may help fix a monitor issue I've had with
another computer. (i.e. The monitor resolution matching with a tint2 panel along the bottom.)

Thanks for this.

Offline

#4 2016-10-28 13:40:08

redefine6
New Member
Registered: 2016-10-28
Posts: 1

Re: Tip: Setting up dual monitors

Great post!  Thank you very much smile

Offline

#5 2016-11-16 17:31:50

matiasv
New Member
Registered: 2016-11-16
Posts: 1

Re: Tip: Setting up dual monitors

Great Post, well written and to the point, thanks.

If you install bunsenlab in a mobile pc, a great tool is autorandr. It let you switch between monitor configurations very easily.

I build a .deb without pm-utils https://github.com/Pelado-Mat/autorandr … dr-0.1.deb

Offline

#6 2018-08-11 12:18:57

theblur
New Member
Registered: 2018-08-11
Posts: 3

Re: Tip: Setting up dual monitors

I was having trouble getting the resolution right on my external VGA monitor 1440x900 resolution. After some googling, this one solved it (Just replace 1440x900 with native resolution of your monitor in the instructions below).
Excellent instructions from arew264 at archlinux forums : https://bbs.archlinux.org/viewtopic.php?id=73738

There are 3 steps :
1. Getting correct 'settings' from gtf utility for my resolution (1440x900). using gtf command.

$ gtf 1440 900 60

  # 1440x900 @ 60.00 Hz (GTF) hsync: 55.92 kHz; pclk: 106.47 MHz
  Modeline "1440x900_60.00"  106.47  1440 1520 1672 1904  900 901 904 932  -HSync +Vsync 

2. Creating and adding a custom resolution to xrandr (which in my case is 1440x900)

$ xrandr --newmode "1440x900_60.00"  106.47  1440 1520 1672 1904  900 901 904 932  -HSync +Vsync
$ xrandr --addmode VGA-0 1440x900_60.00

3. Assigning that resolution to the external monitor (which in my case is VGA-0)

$ xrandr --output VGA-0 --mode 1440x900_60.00

So from start to finish, run these commands one after the other.

$ gtf 1440 900 60

  # 1440x900 @ 60.00 Hz (GTF) hsync: 55.92 kHz; pclk: 106.47 MHz
  Modeline "1440x900_60.00"  106.47  1440 1520 1672 1904  900 901 904 932  -HSync +Vsync

$ xrandr --newmode "1440x900_60.00"  106.47  1440 1520 1672 1904  900 901 904 932  -HSync +Vsync
$ xrandr --addmode VGA-0 1440x900_60.00
$ xrandr --output VGA-0 --mode 1440x900_60.00

Last edited by theblur (2018-08-11 12:22:31)

Offline

Board footer

Powered by FluxBB