description "XSession handling"
author "Stéphane Graber <stgraber@ubuntu.com>"

start on startup
emits xsession

pre-start script
    [ -z "$DESKTOP_SESSION" ] && stop || true
    [ "$SESSIONTYPE" = "gnome-session" ] && initctl set-env --global GNOME_DESKTOP_SESSION_ID=this-is-deprecated || true
end script

script
    exec initctl emit xsession SESSION=$DESKTOP_SESSION SESSIONTYPE=$SESSIONTYPE
end script
