#!/usr/bin/bash

RUN_SDL=1

MESSAGE="\
Angband (SDL) doesn't work on Gnome Desktop because GTK+ refuses to initialize on excecutables that require the setgid feature.\n\n\
Run Angband (X11) instead?"


if [[ "$DESKTOP_SESSION" == "gnome" ]]; then
    zenity \
        --title="Warning" \
        --icon="dialog-warning" \
        --question \
        --text "$MESSAGE"
    RUN_SDL=$?
fi

if [[ "$RUN_SDL" == "0" ]]; then
    angband -mx11
else
    angband -msdl2
fi