From e2295813ea9693d34f541a790eff8ec387bbb107 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 7 Jul 2011 01:51:31 +0200 Subject: [PATCH] wm-ng: make sure fluxbox is present, otherwise fall back to x-window-manager or error out. If fluxbox is not installed but wm-ng is present then make sure wm-ng tries to fall back to the configured x-window-manager, unless it points back to fluxbox or wm-ng again. Otherwise error out with an according error message. --- usr_bin/wm-ng | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/usr_bin/wm-ng b/usr_bin/wm-ng index 0e62170..1660848 100755 --- a/usr_bin/wm-ng +++ b/usr_bin/wm-ng @@ -6,11 +6,19 @@ # License: This file is licensed under the GPL v2. ################################################################################ -gkrellm -g -1+26 & - -(sleep 2; idesk &) & - -fluxbox +# start Grml's fluxbox setup only if fluxbo 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 $? -- 2.1.4