#!/bin/sh
#
# Just a quick and simple run dialog.
# keys file for icewm has keyboard shortcut of: Alt + F2
#
# Take a look at "Xdialog" and use it instead of "dialog" in case X is running
if [[ "$DISPLAY" && "$(which Xdialog 2>&1 | grep -v "which: no")" ]]; then
	d="Xdialog"
else
	d="dialog"
fi

$d --title "RUN DIALOG" --ok-label Run --icon /usr/share/pixmaps/run.xpm \
   --inputbox "Enter program you would like to run below:" 9 50 2> $HOME/inputbox.tmp.$$

retval=$?

input=`cat $HOME/inputbox.tmp.$$`
rm -f $HOME/inputbox.tmp.$$

case $retval in
  0)
    	command="$input";;
  1)
		exit;;
  255)
		exit;;
esac

$command&

exit
