#!/usr/bin/env bash

# This is the maintainence launcher for the snap, make necessary runtime
# environment changes to make the snap work here.  You may also insert security
# confinement/deprecation/obsoletion notice of the snap here.

set \
  -o errexit \
  -o errtrace \
  -o nounset \
  -o pipefail

# gtk-common-themes support
export QT_QPA_PLATFORMTHEME=gtk3
# Correct the TMPDIR path for Chromium Framework/Electron to
# ensure libappindicator has readable resources
export TMPDIR=$XDG_RUNTIME_DIR
# Coerce XDG_CURRENT_DESKTOP to Unity so that App Indicators
# are used and do not fall back to Notification Area applets
# or disappear completely.
export XDG_CURRENT_DESKTOP=Unity

# Finally run the next part of the command chain
exec "${@}"
