Try Xecure’s solution, it worked on mine.
I hadn’t noticed the Active box before, and it didn’t take effect until I clicked Apply.
Code could be added to ~/.screenlayout/default.sh to parse the output of xrandr to see if the 2nd display is connected, and if it is, then setup the screen differently. My add-on screen is HDMI-1.
#!/bin/sh
hdmiactive=$(xrandr | grep "HDMI-1 connected" | wc -l)
if [[ "$hdmiactive" -lt 1 ]]; then
xrandr --output HDMI-1 --off --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
else
xrandr --output HDMI-1 --mode 3840x2160 --pos 0x0 --rotate normal --output eDP-1 --primary --mode 1920x1080 --pos 3840x1080 --rotate normal
fi
-
This reply was modified 1 month ago by BobC.