Remove various scripts
[grml-scripts.git] / usr_bin / wm-ng
index ef17089..d8fc87a 100755 (executable)
@@ -1,17 +1,24 @@
 #!/bin/sh
 # Filename:      wm-ng
 # Purpose:       a wrapper script to call fluxbox with some additional features activated
-# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Authors:       grml-team (grml.org)
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Thu Nov 03 15:32:49 CET 2005 [mika]
 ################################################################################
 
-/usr/bin/gkrellm   &   # -w
-
-(sleep 2; idesk &) &
-
-/usr/bin/fluxbox
+# start Grml's fluxbox setup only if fluxbox is present
+if [ -x "$(which fluxbox 2>/dev/null)" ] ; then
+  gkrellm -g -1+26 &
+  (sleep 2; idesk &) &
+  fluxbox
+elif [ "$(basename $(readlink -f $(which x-window-manager 2>/dev/null)))" != "fluxbox" ] && \
+     [ "$(basename $(readlink -f $(which x-window-manager 2>/dev/null)))" != "$(basename $0)" ] ; then
+    # fall back unless it's set to fluxbox or points back to wm-ng
+    x-window-manager
+else
+  echo "Error: fluxbox not present + x-window-manager is not an alternative neither." >&2
+  exit 1
+fi
 
 exit $?