added some debugging data, real version update will be later today.

This commit is contained in:
inxi-svn 2014-01-13 20:05:31 +00:00
parent ec7691fbc9
commit 31ef4f7e05

106
inxi
View file

@ -1619,6 +1619,12 @@ debug_data_collector()
xrandr &> $debug_data_dir/xrandr.txt
X -version &> $debug_data_dir/x-version.txt
Xorg -version &> $debug_data_dir/xorg-version.txt
echo $GNOME_DESKTOP_SESSION_ID &> $debug_data_dir/gnome-desktop-session-id.txt
# kde 3 id
echo $KDE_FULL_SESSION &> $debug_data_dir/kde3-ful-session.txt
echo $KDE_SESSION_VERSION &> $debug_data_dir/kde456-session-version.txt
echo "$(kded$KDE_SESSION_VERSION --version )" &> $debug_data_dir/kde-version-data.txt
echo $XDG_CURRENT_DESKTOP &> $debug_data_dir/xdg-current-desktop.txt
fi
if [[ $1 == 'disk' || $1 == 'all' ]];then
echo 'Collecting dev, label, disk, uuid data, df...'
@ -3764,6 +3770,8 @@ get_cpu_ht_multicore_smp_data()
# Detect desktop environment in use, initial rough logic from: compiz-check
# http://forlong.blogage.de/entries/pages/Compiz-Check
# NOTE $XDG_CURRENT_DESKTOP envvar is not reliable, but it shows certain desktops better.
# most desktops are not using it as of 2014-01-13 (KDE, UNITY, LXDE. Not Gnome)
get_desktop_environment()
{
eval $LOGFS
@ -3772,10 +3780,57 @@ get_desktop_environment()
local desktop_environment='' xprop_root=''
local version='' version_data='' toolkit=''
# works on 4, assume 5 will id the same, why not, no need to update in future
# KDE_SESSION_VERSION is the integer version of the desktop
if [[ $XDG_CURRENT_DESKTOP == 'KDE' || -n $KDE_SESSION_VERSION ]]; then
# note the command is actually like, kded4 --version, so we construct it
version_data=$( kded$KDE_SESSION_VERSION --version 2>/dev/null )
version=$( grep -si '^KDE Development Platform:' <<< "$version_data" | gawk '{print $4}' )
if [[ -z $version ]];then
version=$KDE_SESSION_VERSION
fi
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
if [[ -n $toolkit ]];then
version="$version (Qt $toolkit)"
fi
fi
desktop_environment="KDE"
# 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
version_data=$( kded --version 2>/dev/null )
version=$( grep -si '^KDE:' <<< "$version_data" | gawk '{print $2}' )
# version=$( get_de_app_version 'kded' '^KDE:' '2' )
if [[ -z $version ]];then
version='3.5'
fi
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
if [[ -n $toolkit ]];then
version="$version (Qt $toolkit)"
fi
fi
desktop_environment="KDE"
elif [[ $XDG_CURRENT_DESKTOP == 'UNITY' ]];then
version=$( get_de_app_version 'unity' '^unity' '2' )
# not certain cinn will always have version, so keep output right if not
if [[ -n $version ]];then
version="$version "
fi
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( get_de_gtk_data )
if [[ -n $toolkit ]];then
version="${version}(Gtk ${toolkit})"
fi
fi
desktop_environment="Unity"
fi
# did we find it? If not, start the xprop tests
if [[ -z $desktop_environment ]];then
if [[ -n $( type -p xprop ) ]];then
xprop_root="$( xprop -root 2>/dev/null )"
fi
# note that cinnamon split from gnome, and and can now be id'ed via xprop,
# but it will still trigger the next gnome true case, so this needs to go before gnome test
# eventually this needs to be better organized so all the xprop tests are in the same
@ -3821,52 +3876,10 @@ get_desktop_environment()
fi
fi
desktop_environment="Gnome"
# assume 5 will id the same, why not, no need to update in future
elif [[ $KDE_SESSION_VERSION == '5' ]]; then
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
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
if [[ -n $toolkit ]];then
version="$version (Qt $toolkit)"
fi
fi
desktop_environment="KDE"
elif [[ $KDE_SESSION_VERSION == '4' ]]; then
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
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
if [[ -n $toolkit ]];then
version="$version (Qt $toolkit)"
fi
fi
desktop_environment="KDE"
# 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
version_data=$( kded --version 2>/dev/null )
version=$( grep -si '^KDE:' <<< "$version_data" | gawk '{print $2}' )
# version=$( get_de_app_version 'kded' '^KDE:' '2' )
if [[ -z $version ]];then
version='3.5'
fi
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
if [[ -n $toolkit ]];then
version="$version (Qt $toolkit)"
fi
fi
desktop_environment="KDE"
if [[ -z $desktop_environment ]];then
# now that the primary ones have been handled, next is to find the ones with unique
# xprop detections possible
else
if [[ -n $xprop_root ]];then
# String: "This is xfdesktop version 4.2.12"
if [[ -n $( grep -Eis '\"xfce4\"' <<< "$xprop_root" ) ]];then
@ -3902,8 +3915,10 @@ get_desktop_environment()
desktop_environment='Blackbox'
fi
elif [[ -n $( grep -is 'OPENBOX_PID' <<< "$xprop_root" ) ]];then
# note: openbox-lxde --version may be present, but returns openbox data
version=$( get_de_app_version 'openbox' '^openbox' '2' )
if [[ -n $( grep -is 'lxde' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
if [[ $XDG_CURRENT_DESKTOP == 'LXDE' || \
-n $( grep -is 'lxde' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
if [[ -n $version ]];then
version="(Openbox $version)"
fi
@ -3989,6 +4004,7 @@ get_desktop_environment()
fi
fi
fi
fi
if [[ -n $version ]];then
version=" $version"
fi