#!/bin/sh
#
# Copyright (C) 2022 by Intevation GmbH
# Authors:
# Thomas Arendsen Hein <thomas@intevation.de>
#
# Set the used X11 screen size to the display size reported by xdpyinfo.
# This is sometimes needed as a workaround if KDE remembered a wrong display
# size when switching between XDMCP sessions with and without X2Go.

xdpyinfo | awk '
    $1 == "dimensions:" && $2 ~ /^[0-9]+x[0-9]+/ {
        system("xrandr -s " $2)
    }
'
