# temporary fix for https://github.com/canonical/lightdm/issues/198 and https://bugs.launchpad.net/lightdm/+bug/1922414
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
}