#!/bin/sh choosedir() { DIR=`Xdialog --title "Level9: Please specify the default directory" --dselect $HOME 0 0 2>&1` case $? in 0) ;; 1) ;; 255) ;; esac } infomsg() { Xdialog --title "Level9: run first time" \ --msgbox "It appears this is the first time you're running Level9. You'll need to specify a directory where your save files are going to be located. This will also be the start directory for all Level9 sessions, so it helps a lot if this directory is close to your Level 9 datafiles. You can change this setting anytime later by editing the ~/.level9-dir file in your home directory with a text editor. Or you can delete it and you will be presented with this dialog again." 15 71 case $? in 0) choosedir;; 255) ;; esac } if [ ! -f ~/.level9-dir ]; then infomsg if [ "$DIR" ]; then echo "$DIR" > ~/.level9-dir fi fi if [ -f ~/.level9-dir ]; then L9DIR=`cat ~/.level9-dir | head -n 1` cd "$L9DIR" /usr/bin/gtklevel9 $@ fi