You are not logged in.

#1 2014-07-12 10:38:14

RichAustin
Member
From: Wakefield, Yorkshire, England
Registered: 2011-07-27
Posts: 186

Dual monitor setup - need laptop on the left

Hi All

I'm running a dual monitor setup - specifically a HP G72 laptop and a widescreen monitor. I use the monitor as the default and sometimes I want to use the Laptop as a secondary screen for watching TV etc. My desktop is Enlightenment, I just changed to it from Gnome. My issue is that I want the laptop to be on the left of the monitor - that's how it is physically positioned - but when I switch the Laptop screen on all my applications shift over to the laptop screen. I've written 2 scripts, attached to hotkeys, one to turn the laptop off and the other to turn the laptop on. The script to turn the laptop on is as follows:

xrandr --output LVDS1 --mode 1600x900 --pos 1600x0 --rotate normal 
          --output VGA1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --left-of LVDS1

This works fine, applications stay where they should be, except that the physical position is incorrect; VGA1 should be to the right of LVDS1 like this:

xrandr --output LVDS1 --mode 1600x900 --pos 1600x0 --rotate normal 
          --output VGA1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --right-of LVDS1

However, when I use the second script all of the applications shift to the laptop but at least the physical position is correct. The issue appears to be something to do with laptops, almost as though when it's a laptop the default monitor is forced to be on the left. Has anybody got any suggestions how to get around this issue?

Thanks
Richard

Offline

#2 2014-07-12 12:15:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Dual monitor setup - need laptop on the left

This is due to your window manager treating the two monitors as a larger 'desktop' area - that combined with your specification of the pos=0x0 you are telling it to do this.

If you have only the VGA output on, the top left corner of the VGA monitor is 0x0.  If you open a window, and it is placed 10 pixels in and down from the top left, it is at coordinates 10x10 in the x session.  Then you turn on the laptop monitor and specify that the top left corner of the laptop monitor should now bo considered 0x0 - but nothing is done to move the windows, so the window with coordinates 10x10 is now near the top left of the laptop monitor.

I see 3 possible ways of acheiving what you want:

1) swap the "pos" parameters in your xrandr commands so that the monitor on the left is always at 0x0 and the one on the right is always at 1920x0 (or whatever).  This will leave a large area of available X desktop that is not visible - I don't know how your window manager will treat this.  It might try to map windows on the laptop screen space even though that screen is not on.  I know openbox is easy to configure where it tries to place windows.

2) Keep the VGA monitor always at 0x0, but place the laptop monitor at a negative offset when you want it on.  I don't actually know if X allows negative coordinates like that, but it's worth a shot.

3) Configure your window manager, or use a different window manager, so that it is aware of the two screens and treats them reasonably (e.g. moves windows when the desktop area is changed).

Last edited by Trilby (2014-07-12 12:15:42)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2014-07-12 19:19:10

RichAustin
Member
From: Wakefield, Yorkshire, England
Registered: 2011-07-27
Posts: 186

Re: Dual monitor setup - need laptop on the left

Trilby

That's a great reply, thanks. I did initially have the pos 1600x0 in the VGA settings and --pos 0x0 for the laptop. I swapped them around after reading somewhere that 0x0 was treated as the default monitor. Stupidly, until I read your comment, I hadn't realised that it was referring to co-ordinates on the screen. It also explains why, when I was experimenting, some windows were overlapping the 2 screens.

Thanks for your help.

Richard

Offline

#4 2014-07-12 22:36:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Dual monitor setup - need laptop on the left

Your welcome - was that actually sufficient to get it all sorted?  I expected to have to dig into it a bit more.  But if it's all set no, please remember to mark the thread as [ SOLVED ].


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2014-07-13 00:16:26

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Dual monitor setup - need laptop on the left

Just set your xorg.conf up to put the monitors in the right place.  I have to do this with awesome, because if I run xrandr after awesome is already running, it has trouble with the differing desktop sizes.  Then your applications show up wherever you want them.  Be sure your external is plugged in when xorg starts.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#6 2014-07-13 00:17:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Dual monitor setup - need laptop on the left

You can also put xrandr commands in your xinitrc before the window manager starts.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2014-07-13 00:21:41

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Dual monitor setup - need laptop on the left

Trilby wrote:

You can also put xrandr commands in your xinitrc before the window manager starts.

I set up xorg.conf because of slim, so same difference.  Otherwise it would have to do it again.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#8 2014-07-13 15:14:27

RichAustin
Member
From: Wakefield, Yorkshire, England
Registered: 2011-07-27
Posts: 186

Re: Dual monitor setup - need laptop on the left

Thanks for the help on this, I'll try out the different ideas when I get a chance. I think the difficulty is coming from the fact I only switch the laptop screen on when I actually want to use it.

At work I have both screens on permanently but at home I don't need this. I just use the laptop screen for watching sport or maybe some documentation etc. Just being able to blank the screen would work just as well I guess, for example if I could turn the brightness down to zero so the screen just goes black. Actually, is there a way of doing this? The brightness control at the moment just makes the laptop go darker but not completely blanked out.

In Windows I go through the laborious process of setting the output and then re-arranging the monitor positions. I use Arch more so would love a permanent simple solution - hence the idea of having screenOn / screenOff scripts.

Richard

Last edited by RichAustin (2014-07-13 15:15:08)

Offline

Board footer

Powered by FluxBB