2

I recently upgraded to Xubuntu 14.04 on my laptop. Prior to 14.04, I used xrandr (through a script) to configure my preferred layout, which involved an external VGA monitor and the built in laptop monitor. Prior to 14.04, when I closed the lid with that layout active, the layout remained the same (ie, the built-in monitor was off, but still present in the layout).

After upgrading to 14.04, my xrandr layout is retained only for as long as I don't close the lid on the laptop. After the lid is closed, the external monitor is reconfigured as the only display. After the lid is reopened, Xfce seems to restore whatever configuration I had set for the two monitors in the displays dialog prior to closing the lid. This is suboptimal for me, as I cannot make the monitors bottom-aligned through that dialog, which is why I'd prefer my xrandr layout be respected through lid closes.

A previous question suggests looking into ACPI configuration and removing lid close scripts there, but I seem to have no scripts that do anything with the lid in /etc/acpi. I also haven't been able to find anything to do with lid closes in /etc/udev. Xfce power manager is set to do nothing with lid closes, and that setting seems to be respected – if I set it to suspend, it suspends. The "Configure new displays when connected" checkbox in Xfce display settings is unchecked.

D__
  • 21

1 Answers1

0

After many cycles over many weeks, today I solved the two external monitors being reconfigured incorrectly after screen unlock problem with xfce and other desktops:

Different monitors have different "start up" or "monitor boot" latency - in the order of a second, perhaps more with monitors I don't have.

This latency means that even using a keyboard combo to run own xrandr config (perhaps embedded in a script file), has often failed.

Tried using xrandr to first disable all outputs, then wait say 3 seconds. This did not work - it's the monitors "turning on" where this problem lies and my old (~7 years?) Intel i7-2640M with inbuilt "Intel HD Graphics 3000", presumably fails to maintain the desired display port output config for long enough for at least one of my (4K) external monitors to start up.

SOLUTION: run xrandr in 2 steps - first enable one external monitor only, then sleep 1s (I've tried 0.6s, but that was insufficient), then enable both monitors, e.g. like so (vary to suit your monitors of course):

xrandr --output LVDS1 --off --output DP1 --mode "3840x1080" --pos "0x580" --rate 60 --output DP2 --off                                                                                              
sleep 1s
xrandr --output LVDS1 --off --output DP1 --mode "3840x1080" --pos "0x580" --rate 60 --output DP2 --mode "3840x2160" --pos "3840x0"

Attach such a sequence (in a script) to your chosen keyboard shortcut, then after unlocking the screen (XFCE, KDE, whatever), use the shortcut to run this script.

Apparently same issue here (posted same answer there):

https://forum.xfce.org/viewtopic.php?pid=54610#p54610

zenaan
  • 111