#!/usr/bin/env bash
# Govibe PC Specs launcher
# Keeps Fedora/GNOME terminal clean while preserving real errors.
export GDK_BACKEND="${GDK_BACKEND:-x11}"
export NO_AT_BRIDGE="${NO_AT_BRIDGE:-1}"
export PYTHONWARNINGS="ignore::DeprecationWarning:gi.repository,ignore::DeprecationWarning,ignore::PendingDeprecationWarning"
USER_PY="$HOME/.local/share/govibepcspecs/govibepcspecs.py"
SYSTEM_PY="/usr/share/govibepcspecs/govibepcspecs.py"
if [ -f "$USER_PY" ]; then
  PY_APP="$USER_PY"
elif [ -f "$SYSTEM_PY" ]; then
  PY_APP="$SYSTEM_PY"
else
  echo "Govibe PC Specs source file not found." >&2
  echo "Looked for: $USER_PY and $SYSTEM_PY" >&2
  exit 1
fi
exec python3 "$PY_APP" "$@" 2> >(grep -vE "PyGIWarning|PyGTKDeprecationWarning|DeprecationWarning|Gtk-CRITICAL.*gtk_widget_get_scale_factor|Gtk-WARNING.*no trigger event" >&2)
