diff -u /etc/x2go/Xsession.orig /etc/x2go/Xsession --- /etc/x2go/Xsession.orig 2022-02-17 22:09:39.000000000 +0100 +++ /etc/x2go/Xsession 2022-02-20 00:46:48.847537872 +0100 @@ -77,6 +77,24 @@ ALTUSERXSESSION=$HOME/.Xsession-x2go ERRFILE="${HOME}/.xsession-x2go-${cur_hostname}-errors" +OPTIONS="$( + if [ -r "$OPTIONFILE" ]; then + cat "$OPTIONFILE" + fi + if [ -d /etc/X11/Xsession.options.d ]; then + run-parts --list --regex '\.conf$' /etc/X11/Xsession.options.d | xargs -d '\n' cat + fi +)" + +has_option() { + # Ensure that a later no-foo overrides an earlier foo + if [ "$(echo "$OPTIONS" | grep -Eo "^(no-)?$1\>" | tail -n 1)" = "$1" ]; then + return 0 + else + return 1 + fi +} + # Move the old error log file away. if [ -f "${ERRFILE}" ]; then if [ -L "${ERRFILE}" ]; then