#!/bin/sh

# Keep Qt portal integration when a portal service is available. Avoid noisy
# D-Bus activation failures on minimal systems that do not run one.
if [ "$(busctl --user call org.freedesktop.DBus /org/freedesktop/DBus \
        org.freedesktop.DBus NameHasOwner s org.freedesktop.portal.Desktop \
        2>/dev/null)" != "b true" ]; then
  export QT_NO_XDG_DESKTOP_PORTAL=1
fi

exec /usr/lib/duckstation/duckstation-qt "$@"
