loosened regex to handle future things like git, v12.2, b12.2 or whatever for desktop versions

This commit is contained in:
inxi-svn 2011-05-21 23:31:07 +00:00
parent 0fc3ba54da
commit c85ef425c5

15
inxi
View file

@ -2640,13 +2640,13 @@ detect_desktop_environment()
desktop_environment="Xfce" desktop_environment="Xfce"
elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then
if [[ -n $( grep -is 'fluxbox' <<< "$ps_aux" | grep -v 'grep' ) ]];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' desktop_environment='Fluxbox'
else else
desktop_environment='Blackbox' desktop_environment='Blackbox'
fi fi
elif [[ -n $( grep -is 'OPENBOX_PID' <<< "$xprop_root" ) ]];then 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 $( grep -is 'lxde' <<< "$ps_aux" | grep -v 'grep' ) ]];then
if [[ -n $version ]];then if [[ -n $version ]];then
version="(Openbox $version)" version="(Openbox $version)"
@ -2656,23 +2656,24 @@ detect_desktop_environment()
desktop_environment='Openbox' desktop_environment='Openbox'
fi fi
elif [[ -n $( grep -is 'ICEWM' <<< "$xprop_root" ) ]];then 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' desktop_environment='IceWM'
fi fi
fi fi
# a few manual hacks for things that don't id with xprop, these are just good guesses # 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 [[ -z $desktop_environment ]];then
if [[ -n $( grep -is 'fvwm-crystal' <<< "$ps_aux" | grep -v 'grep' ) ]];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' desktop_environment='FVWM-Crystal'
elif [[ -n $( grep -is 'fvwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then 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' desktop_environment='FVWM'
elif [[ -n $( grep -is 'pekwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then 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' desktop_environment='pekwm'
elif [[ -n $( grep -is 'awesome' <<< "$ps_aux" | grep -v 'grep' ) ]];then 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' desktop_environment='Awesome'
fi fi
fi fi