From c85ef425c5f4b1373e271ef1d82260636275798d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 21 May 2011 23:31:07 +0000 Subject: [PATCH] loosened regex to handle future things like git, v12.2, b12.2 or whatever for desktop versions --- inxi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/inxi b/inxi index 519a11c..561a32f 100755 --- a/inxi +++ b/inxi @@ -2640,13 +2640,13 @@ detect_desktop_environment() desktop_environment="Xfce" elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then if [[ -n $( grep -is 'fluxbox' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'fluxbox' 'fluxbox[[:space:]]([[:digit:]]|GIT)' '2' ) + version=$( get_de_version 'fluxbox' '^fluxbox' '2' ) desktop_environment='Fluxbox' else desktop_environment='Blackbox' fi elif [[ -n $( grep -is 'OPENBOX_PID' <<< "$xprop_root" ) ]];then - version=$( get_de_version 'openbox' 'openbox[[:space:]]([[:digit:]]|GIT)' '2' ) + version=$( get_de_version 'openbox' '^openbox' '2' ) if [[ -n $( grep -is 'lxde' <<< "$ps_aux" | grep -v 'grep' ) ]];then if [[ -n $version ]];then version="(Openbox $version)" @@ -2656,23 +2656,24 @@ detect_desktop_environment() desktop_environment='Openbox' fi elif [[ -n $( grep -is 'ICEWM' <<< "$xprop_root" ) ]];then - version=$( get_de_version 'icewm' 'icewm[[:space:]]([[:digit:]]|GIT)' '2' ) + version=$( get_de_version 'icewm' '^icewm' '2' ) desktop_environment='IceWM' fi fi # a few manual hacks for things that don't id with xprop, these are just good guesses + # note that gawk is going to exit after first occurance of search string, so no need for extra if [[ -z $desktop_environment ]];then if [[ -n $( grep -is 'fvwm-crystal' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'fvwm' 'fvwm[[:space:]]([[:digit:]]|GIT)' '2' ) + version=$( get_de_version 'fvwm' '^fvwm' '2' ) desktop_environment='FVWM-Crystal' elif [[ -n $( grep -is 'fvwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'fvwm' 'fvwm[[:space:]]([[:digit:]]|GIT)' '2' ) + version=$( get_de_version 'fvwm' '^fvwm' '2' ) desktop_environment='FVWM' elif [[ -n $( grep -is 'pekwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'pekwm' 'pekwm.*([[:digit:]]|GIT)' '3' ) + version=$( get_de_version 'pekwm' '^pekwm' '3' ) desktop_environment='pekwm' elif [[ -n $( grep -is 'awesome' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'awesome' 'awesome' '2' ) + version=$( get_de_version 'awesome' '^awesome' '2' ) desktop_environment='Awesome' fi fi