New version. kdesu and gksu support.

Code:
--- install	2005-12-20 13:11:44.000000000 -0500
+++ install.xterm	2006-01-05 14:10:20.000000000 -0500
@@ -81,6 +81,59 @@
  esac
 }
 
+# Determine the native X vt
+export NATIVEXVT=rxvt
+if [ "$DIALOG" = "kdialog" ]
+then
+  export NATIVEXVT="konsole --nomenubar --notabbar --noframe --noscrollbar"
+elif [ "$DIALOG" = "zenity" ]
+then
+  export NATIVEXVT="gnome-terminal --hide-menubar"
+fi
+
+unset XVT
+# Determine what X virtual terminal to use (if applicable)
+if [ "$DISPLAY" -a "`tty | grep not`" ]
+then
+  for i in xterm \
+        rxvt \
+        "$NATIVEXVT"
+  do
+    $i --help
+    if [ "$?" != "127" ]
+    then
+      export XVT="$i -e"
+    fi
+  done
+fi
+
+# Determine how to su
+unset GUISU
+if [ "$DIALOG" = "kdialog" ]
+then
+  kdesu --help
+  if [ "$?" != "127" ]
+  then
+    export GUISU="kdesu -c"
+  fi
+elif [ "$DIALOG" = "zenity" ]
+then
+  gksu --help
+  if [ "$?" != "127" ]
+  then
+    export GUISU=gksu
+  fi
+fi
+
+visisu() {
+  if [ "$GUISU" ]
+  then
+    $GUISU $@
+  else
+    $XVT /bin/bash -c "echo Please enter your root password:; su -c $@"
+  fi
+}
+
 cat > $HOME/.klik <<\EOF
 #!/bin/bash
 
@@ -512,7 +565,17 @@
 EOF
 chmod 777 "$HOME/klik-cmg-install-root"
 
-(sudo sh "$HOME/klik-cmg-install-root" && rm -f "$HOME/klik-cmg-install-root") || (dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root.") 
+# Try su'ing to root
+visisu $HOME/klik-cmg-install-root
+
+# If that didn't work, just tell the user what to do
+if [ -z "$(cat /etc/fstab | grep app/7)" ]
+then
+  dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root."
+else
+  rm -f "$HOME/klik-cmg-install-root"
+fi
+
 fi
 
 #