diff --git a/inxi b/inxi index 43c232f..21e3865 100755 --- a/inxi +++ b/inxi @@ -3032,7 +3032,7 @@ get_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 [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then - version=$( get_de_version 'gnome-about' 'gnome' '3' ) + version=$( get_de_app_version 'gnome-about' 'gnome' '3' ) if [[ $B_EXTRA_DATA == 'true' ]];then # this is a hack, and has to be changed with every toolkit version change toolkit=$( pkg-config --modversion gtk+-3.0 2>/dev/null ) @@ -3076,7 +3076,7 @@ get_desktop_environment() elif [[ $KDE_FULL_SESSION == 'true' ]]; then version_data=$( kded --version 2>/dev/null ) version=$( grep -si '^KDE:' <<< "$version_data" | gawk '{print $2}' ) - # version=$( get_de_version 'kded' '^KDE:' '2' ) + # version=$( get_de_app_version 'kded' '^KDE:' '2' ) if [[ -z $version ]];then version='3.5' fi @@ -3095,12 +3095,12 @@ get_desktop_environment() xprop_root="$( xprop -root 2>/dev/null )" # String: "This is xfdesktop version 4.2.12" if [[ -n $( grep -Eis '\"xfce4\"' <<< "$xprop_root" ) ]];then - version=$( get_de_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' ) + version=$( get_de_app_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' ) if [[ -z $version ]];then version='4' fi if [[ $B_EXTRA_DATA == 'true' ]];then - toolkit=$( get_de_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' ) + toolkit=$( get_de_app_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' ) if [[ -n $toolkit ]];then version="$version (Gtk $toolkit)" fi @@ -3108,12 +3108,12 @@ get_desktop_environment() desktop_environment="Xfce" # when 5 is released, the string may need updating elif [[ -n $( grep -is '\"xfce5\"' <<< "$xprop_root" ) ]];then - version=$( get_de_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' ) + version=$( get_de_app_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' ) if [[ -z $version ]];then version='5' fi if [[ $B_EXTRA_DATA == 'true' ]];then - toolkit=$( get_de_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' ) + toolkit=$( get_de_app_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' ) if [[ -n $toolkit ]];then version="$version (Gtk $toolkit)" fi @@ -3121,13 +3121,13 @@ get_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' '2' ) + version=$( get_de_app_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' '2' ) + version=$( get_de_app_version 'openbox' '^openbox' '2' ) if [[ -n $( grep -is 'lxde' <<< "$ps_aux" | grep -v 'grep' ) ]];then if [[ -n $version ]];then version="(Openbox $version)" @@ -3137,7 +3137,7 @@ get_desktop_environment() desktop_environment='Openbox' fi elif [[ -n $( grep -is 'ICEWM' <<< "$xprop_root" ) ]];then - version=$( get_de_version 'icewm' '^icewm' '2' ) + version=$( get_de_app_version 'icewm' '^icewm' '2' ) desktop_environment='IceWM' elif [[ -n $( grep -is 'ENLIGHTENMENT' <<< "$xprop_root" ) ]];then # no -v or --version but version is in xprop -root @@ -3150,30 +3150,30 @@ get_desktop_environment() # 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' '2' ) + version=$( get_de_app_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' '2' ) + version=$( get_de_app_version 'fvwm' '^fvwm' '2' ) desktop_environment='FVWM' elif [[ -n $( grep -is 'pekwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'pekwm' '^pekwm' '3' ) + version=$( get_de_app_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_app_version 'awesome' '^awesome' '2' ) desktop_environment='Awesome' elif [[ -n $( grep -is 'scrotwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'scrotwm' '^welcome.*scrotwm' '4' ) + version=$( get_de_app_version 'scrotwm' '^welcome.*scrotwm' '4' ) desktop_environment='Scrotwm' # no --version for this one elif [[ -n $( grep -is '[[:space:]]twm' <<< "$ps_aux" | grep -v 'grep' ) ]];then desktop_environment='Twm' # no --version for this one elif [[ -n $( grep -is '[[:space:]]dwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'dwm' '^dwm' '1' ) + version=$( get_de_app_version 'dwm' '^dwm' '1' ) desktop_environment='dwm' elif [[ -n $( grep -is 'wmii' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'wmii' '^wmii' '1' ) + version=$( get_de_app_version 'wmii' '^wmii' '1' ) desktop_environment='wmii' elif [[ -n $( grep -is '[[:space:]]jwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then - version=$( get_de_version 'jwm' '^jwm' '2' ) + version=$( get_de_app_version 'jwm' '^jwm' '2' ) desktop_environment='JWM' fi fi @@ -3187,7 +3187,7 @@ get_desktop_environment() # note: gawk doesn't support white spaces in search string, gave errors, so use [[:space:]] instead # args: $1 - desktop command for --version; $2 - search string; $3 - gawk print number -get_de_version() +get_de_app_version() { local version_data='' version='' get_version='--version'