One laptop and one external monitor.
The laptop screen is the primary monitor (LVDS1)
The external monitor is the secondary monitor, orientated left (HDMI1)
When the lid of the laptop is put down and then raised, the screens do not retain resolution settings and does either one of the following:
Laptop LCD off
Laptop LCD resolution wrong
External monitor rotated back to normal instead of orientated left.
Why this is happening:
It seems that there are too many things that can cause the screen resolution to change, including ACPI daemon, mate screensaver, lid.sh…. Too many cooks spoil the broth….
The manual solution is to unplug the HDMI cable and lower and raise the lid and then plug HDMI back in. Not good enough.
Control freak Solution:
First get your screen setup right, use the ‘mate-display-properties’ to get your resolution and orientation correct.
Then open ‘mateconf-editor’ and tweak these settings:
apps/mate-power-manager/buttons lid_ac = nothing
This will now prevent your system form changing your monitor settings on your behalf.
In a command line as a normal user excute the xrandr command.
Screen 0: minimum 320 x 200, current 2266 x 1440, maximum 8192 x 8192
LVDS1 connected 1366x768+0+327 (normal left inverted right x axis y axis) 344mm x 193mm
1360x768 59.8 60.0
800x600 60.3 56.2
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 900x1440+1366+0 left (normal left inverted right x axis y axis) 410mm x 256mm
1440x900 59.9*+ 75.0
1280x1024 75.0 60.0
1024x768 75.1 70.1 60.0
800x600 72.2 75.0 60.3 56.2
640x480 72.8 75.0 66.7 60.0
DP1 disconnected (normal left inverted right x axis y axis
translating from the xrandr output, a single line command to reset the screen to the desired dimension can be found:
xrandr –output LVDS1 –mode 1366×768 –rotate normal –output HDMI1 –mode 1440×900 –rotate left –right-of LVDS1
Now at this stage, depending on your situation, you can ‘hardcode’ you configuration into your system and make it stick OR crate a xrandr script that is manually activated.
looking in /etc/acpi/events/lidbtn shows that the script /etc/acpi/lid.sh
is called when the lid button is activated
# Called when the user closes or opens the lid
Having a look in the last line of /etc/acpi/lid.sh yeilds this:
[ -x /etc/acpi/local/lid.sh.post ] && /etc/acpi/local/lid.sh.post
This file lid.sh.post, if exists is excututed when the lis switch is activated. Note that this file does not exist by default, so it needs to be made.
sudo mkdir /etc/acpi/local/
sudo touch lid.sh.post
add this to the file lid.sh.post
xrandr --output LVDS1 --mode 1366x768 --rotate normal --pos 0x327 --output HDMI1 --mode 1440x900 --rotate left --pos 1366x0 --right-of LVDS1
then make it excutable:
sudo chmod +x lid.sh.post
Test to see if the lid closing and opening changes the screen setup.