Here's my modified version of that script ( with KDE changes found elsewhere )
#!/bin/bash
# (if using as a KDE autostart script)
# sleep 10
# change these 4 variables accordingly
ORIG_X=2880
ORIG_Y=1800
NEW_X=2810
NEW_Y=1800
###
#Modify to multiple of 8. Issues with window sizing etc without these next two lines.
NEW_X=$(($NEW_X/8*8))
NEW_Y=$(($NEW_Y/8*8))
X_DIFF=$(($NEW_X - $ORIG_X))
Y_DIFF=$(($NEW_Y - $ORIG_Y))
# Uncomment the next line to use left portion of screen:
#X_DIFF=0
# Uncomment the next line to use upper portion of screen:
#Y_DIFF=0
ORIG_RES="$ORIG_X"x"$ORIG_Y"
NEW_RES="$NEW_X"x"$NEW_Y"
ACTIVEOUTPUT=$(xrandr | grep -e " connected [^(]" | sed -e "s/\([A-z0-9]\+\) connected.*/\1/")
MODELINE=$(cvt $NEW_X $NEW_Y | grep Modeline | cut -d' ' -f3-)
xrandr --newmode $NEW_RES $MODELINE
xrandr --addmode $ACTIVEOUTPUT $NEW_RES
xrandr --output $ACTIVEOUTPUT --fb $NEW_RES --panning $NEW_RES --mode $NEW_RES
xrandr --fb $NEW_RES --output $ACTIVEOUTPUT --mode $ORIG_RES --transform 1,0,$X_DIFF,0,1,$Y_DIFF,0,0,1
# KDE specific -- restart shell so that icon tray is properly sized
# kquitapp5 plasmashell
# kstart5 plasmashell
SDDM:
To have this take effect at the sddm login screen put an echo in front of each xrandr line then copy the resulting xrandr commands into the sddm startup. If you are running KDE you will need to disable KScreen to carry over the settings into KDE Plasma.
With your display connected run...
grep "Manufacturer:" /var/log/Xorg.0.log
... to look up the display in your /var/log/Xorg.0.log and modify the if grep line below accordingly.
Don't forget to change the xrandr lines as mentioned above.
Add to your /usr/share/sddm/scripts/Xsetup:
if grep -q -wi "Manufacturer: SKY Model: 1801" /var/log/Xorg.0.log; then
xrandr --newmode 2872x2160 531.25 2872 3104 3416 3960 2160 2163 2173 2237 -hsync +vsync
xrandr --addmode HDMI-A-0 2872x2160
xrandr --output HDMI-A-0 --fb 2872x2160 --panning 2872x2160 --mode 2872x2160
xrandr --fb 2872x2160 --output HDMI-A-0 --mode 3840x2160 --transform 1,0,-968,0,1,0,0,0,1
fi