#!/usr/bin/env bash
rm -f ~/.config/mux/.dashboard-switch
python3 ~/.config/mux/dashboard.py 2>"${TMPDIR:-/tmp}/mux-dashboard-err.log"
rc=$?
if [ $rc -ne 0 ]; then
  echo ""
  echo "  Error (exit $rc):"
  cat "${TMPDIR:-/tmp}/mux-dashboard-err.log"
  echo ""
  read -n1 -s -p "  Press any key to close"
  exit 0
fi
if [ -f ~/.config/mux/.dashboard-switch ]; then
    sh ~/.config/mux/.dashboard-switch
    rm -f ~/.config/mux/.dashboard-switch
fi
