Docking screen with xrandr is unreliable
I use the following aliases to dock my laptop to external monitor
xout='xrandr --output'
wp='feh --bg-fill $(find -L ${HOME}/img/wp/ -type f |sort -R |head -1)'
dock='pkill compton; xout VGA-1 --auto; xout LVDS-1 --off; wp; compton -b'
undock='xout LVDS-1 --off; xout LVDS-1 --auto; xout VGA-1 --off; sleep 5; xout LVDS-1 --auto; wp'
and sometimes external screen will not snow anything after docking, sometimes it will use the laptop's resolution instead of its own. Sometimes when either undocking or killing X (I run xdm so it restarts X automatically) the laptop's screen will show 1024x768 instead of 1366x768.
Setup:
Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz
X11 Modesetting driver
Arch Linux
Linux freebird 4.20.6-arch1-1-ARCH #1 SMP PREEMPT Thu Jan 31 08:22:01 UTC 2019 x86_64 GNU/Linux
xorg-server 1.20.3-1
xorg-xdm 1.1.11+50+gb685338-1
xorg-xev 1.2.2-2
xorg-xinput 1.6.2-2
xorg-xmodmap 1.0.9-2
Edited by Ghost User