From 095313fa268ad0a400f6f5c5646852f881cb5f69 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 19 May 2011 05:03:14 +0000 Subject: [PATCH] added kde version, and qt version, output --- inxi | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index b95875c..22b2419 100755 --- a/inxi +++ b/inxi @@ -2546,7 +2546,8 @@ detect_desktop_environment() eval $LOGFS # set the default, this function only runs in X, if null, don't print data out - local desktop_environment='N/A' xprop_root='' ps_aux='' + local desktop_environment='N/A' xprop_root='' ps_aux='' + local version='' version_data='' toolkit='' # note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out # https://bugzilla.gnome.org/show_bug.cgi?id=542880 @@ -2555,12 +2556,40 @@ detect_desktop_environment() # assume 5 will id the same, why not, no need to update in future elif [[ $KDE_SESSION_VERSION == '5' ]]; then desktop_environment='KDE 5' + version_data=$( kded5 --version 2>/dev/null ) + version=$( grep -si '^KDE Development Platform:' <<< "$version_data" | gawk '{print $4}' ) + if [[ -z $version ]];then + version='5' + fi + toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' ) + if [[ -n $toolkit ]];then + version="$version (Qt: $toolkit)" + fi + desktop_environment="KDE $version" elif [[ $KDE_SESSION_VERSION == '4' ]]; then - desktop_environment='KDE 4' + version_data=$( kded4 --version 2>/dev/null ) + version=$( grep -si '^KDE Development Platform:' <<< "$version_data" | gawk '{print $4}' ) + if [[ -z $version ]];then + version='4' + fi + toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' ) + if [[ -n $toolkit ]];then + version="$version (Qt: $toolkit)" + fi + desktop_environment="KDE $version" # KDE_FULL_SESSION property is only available since KDE 3.5.5. # src: http://humanreadable.nfshost.com/files/startkde elif [[ $KDE_FULL_SESSION == 'true' ]]; then - desktop_environment='KDE 3.5' + version_data=$( kded --version 2>/dev/null ) + version=$( grep -si '^KDE:' <<< "$version_data" | gawk '{print $2}' ) + if [[ -z $version ]];then + version='3.5' + fi + toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' ) + if [[ -n $toolkit ]];then + version="$version (Qt: $toolkit)" + fi + desktop_environment="KDE $version" # note: fluxbox has a positive PID for blackbox, so I think most desktops can be detected # with some work. elif [[ -n $( type -p xprop ) ]];then