From 0248ae7d3016429e77554be887c31916c01243cd Mon Sep 17 00:00:00 2001
From: Christopher <christopher.spinrath@rwth-aachen.de>
Date: Sat, 27 Sep 2014 15:45:39 +0200
Subject: [PATCH] linuxparty.sh: auto detect GUI

---
 scripts/linuxparty.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/linuxparty.sh b/scripts/linuxparty.sh
index e7f81be..72e0684 100644
--- a/scripts/linuxparty.sh
+++ b/scripts/linuxparty.sh
@@ -4,9 +4,19 @@ set -e
 
 #options for GUI are kdialog zenity none
 if [ -z "$GUI" ]; then
-  GUI=kdialog
+  echo "\$GUI is not set. Auto detecting GUI..."
+
+  if command -v zenity 2>&1 > /dev/null; then
+    GUI=zenity
+  elif command -v kdialog 2>&1 > /dev/null; then
+    GUI=kdialog
+  else
+    GUI=none
+  fi
 fi
 
+echo "Using GUI=$GUI."
+
 if [ "$GUI" == "none" ]; then
   NOGUI=yes
 fi
-- 
GitLab