#!/usr/bin/sh

if [ -r /etc/profile.d/qubes-session.sh ]; then
    # shellcheck disable=SC1091
    . /etc/profile.d/qubes-session.sh
fi

# gvfs-open, kde-open, and possibly others don't wait for editor to be
# closed, which is critical behaviour for DisposableVM (which gets destroyed
# after this process exits).
# The "| cat" is rather silly hack, to wait for all the children processes too
# (unless they close their stdout). This is needed on Xfce template, because
# exo-open starts the application in the background, but keeps the original
# stdout/err connected.
export DE=generic
exec xdg-open "$@" | cat
