From 58fccc20a17c6a46c780938fb49e5a536e769dd6 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 19 May 2011 06:53:57 +0000 Subject: [PATCH] cleaned up code a bit --- inxi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index d1ff49b..91191af 100755 --- a/inxi +++ b/inxi @@ -2551,7 +2551,7 @@ detect_desktop_environment() # note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out # https://bugzilla.gnome.org/show_bug.cgi?id=542880 - if [[ ! -z $GNOME_DESKTOP_SESSION_ID ]]; then + if [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then version=$( gnome-about --version 2>/dev/null | gawk '{print $3}' ) if [[ -n $version ]];then version=" $version" @@ -2651,8 +2651,10 @@ detect_desktop_environment() version=" $version" fi desktop_environment="IceWM${version}" - # a few manual hacks for things that don't id with xprop, these are just good guesses - elif [[ -n $( grep -is 'fvwm-crystal' <<< "$ps_aux" | grep -v 'grep' ) ]];then + fi + # a few manual hacks for things that don't id with xprop, these are just good guesses + else + if [[ -n $( grep -is 'fvwm-crystal' <<< "$ps_aux" | grep -v 'grep' ) ]];then version=$( fvwm --version 2>/dev/null | grep -Esi 'fvwm [[:digit:]]' | gawk '{print $2}' ) if [[ -n $version ]];then version=" $version"