#!/bin/sh
#
# mu-gemini-coder - Desktop Launcher Wrapper
# Copyright (C) 2026 Your Name <your.email@example.com>
# License: GPL-2.0-or-later

if [ -f "$HOME/.profile" ]; then . "$HOME/.profile"; fi
if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc"; fi

if [ -z "$GEMINI_API_KEY" ]; then
    if command -v zenity >/dev/null 2>&1; then
        zenity --error --title="mu-gemini-coder Error" --text="The environment variable 'GEMINI_API_KEY' is missing.\n\nPlease export it in your ~/.profile or ~/.bashrc file before using the desktop shortcut."
    else
        echo "Error: GEMINI_API_KEY environment variable is not set."
    fi
    exit 1
fi

exec /usr/bin/mu-gemini-coder