if [ "$1" = configure ] && [ -z "$2" ] && [ -r /usr/share/PACKAGE/default-session.txt ]; then
    session=$(cat /usr/share/PACKAGE/default-session.txt)

    # LightDM
    if [ ! -e /etc/lightdm/lightdm.conf.d/custom.conf ]; then
	mkdir -p /etc/lightdm/lightdm.conf.d/
	cat <<EOF > /etc/lightdm/lightdm.conf.d/custom.conf
[SeatDefaults]
user-session=$session
EOF
    fi

    # gdm
    if [ ! -e /etc/gdm/custom.conf ]; then
	mkdir -p /etc/gdm/
	cat <<EOF > /etc/gdm/custom.conf
[daemon]
DefaultSession=$session
EOF
    fi

fi
