improved cinnamon desktop support for -S, apparently cinnamon has forked from gnome proper, and is now identifiable

via xprop, so that is now moved to full desktop version handling. This requires bypassing the gnome test, which
is a good thing, because the gnome test uses a deprecated method for gnome detection. Still works, but best to
move from it no matter what.

New tarball, new inxi version.
This commit is contained in:
inxi-svn 2012-09-16 17:59:06 +00:00
parent 04315716c1
commit a5731b47b5

54
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.8.15 #### version: 1.8.16
#### Date: September 11 2012 #### Date: September 16 2012
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -1480,7 +1480,7 @@ debug_data_collector()
cat /etc/mtab &> $debug_data_dir/etc-mtab.txt cat /etc/mtab &> $debug_data_dir/etc-mtab.txt
fi fi
echo 'Creating inxi output file now. This can take a few seconds...' echo 'Creating inxi output file now. This can take a few seconds...'
$SCRIPT_NAME -Fploudxx -c 0 -@ 8 > $debug_data_dir/inxi-Fploudxx.txt $SCRIPT_NAME -FRploudxxx -c 0 -@ 8 > $debug_data_dir/inxi-FRploudxxx.txt
cp $LOG_FILE $SCRIPT_DATA_DIR/$debug_data_dir cp $LOG_FILE $SCRIPT_DATA_DIR/$debug_data_dir
if [[ -f $debug_data_dir.tar.gz ]];then if [[ -f $debug_data_dir.tar.gz ]];then
echo "Found and removing previous tar.gz data file: $debug_data_dir.tar.gz" echo "Found and removing previous tar.gz data file: $debug_data_dir.tar.gz"
@ -3250,16 +3250,31 @@ get_desktop_environment()
local desktop_environment='' xprop_root='' ps_aux='' local desktop_environment='' xprop_root='' ps_aux=''
local version='' version_data='' toolkit='' local version='' version_data='' toolkit=''
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
if [[ -n $( grep -is '^_MUFFIN' <<< "$xprop_root" ) ]];then
version=$( get_de_app_version 'cinnamon' '^cinnamon' '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="Cinnamon"
# note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out # note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out
# https://bugzilla.gnome.org/show_bug.cgi?id=542880 # https://bugzilla.gnome.org/show_bug.cgi?id=542880
if [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then
version=$( get_de_app_version 'gnome-about' 'gnome' '3' ) version=$( get_de_app_version 'gnome-about' 'gnome' '3' )
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
# this is a hack, and has to be changed with every toolkit version change toolkit=$( get_de_gtk_data )
toolkit=$( pkg-config --modversion gtk+-3.0 2>/dev/null )
if [[ -z $toolkit ]];then
toolkit=$( pkg-config --modversion gtk+-2.0 2>/dev/null )
fi
if [[ -n $toolkit ]];then if [[ -n $toolkit ]];then
version="$version (Gtk $toolkit)" version="$version (Gtk $toolkit)"
fi fi
@ -3312,8 +3327,7 @@ get_desktop_environment()
# xprop detections possible # xprop detections possible
else else
ps_aux="$( ps aux )" ps_aux="$( ps aux )"
if [[ -n $( type -p xprop ) ]];then if [[ -n $xprop_root ]];then
xprop_root="$( xprop -root 2>/dev/null )"
# String: "This is xfdesktop version 4.2.12" # String: "This is xfdesktop version 4.2.12"
if [[ -n $( grep -Eis '\"xfce4\"' <<< "$xprop_root" ) ]];then if [[ -n $( grep -Eis '\"xfce4\"' <<< "$xprop_root" ) ]];then
version=$( get_de_app_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' ) version=$( get_de_app_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' )
@ -3460,7 +3474,7 @@ get_desktop_extra_data()
desktops="" desktops=""
separator="" separator=""
} }
/(cinnamon|gnome-shell|gnome-panel|kicker|lxpanel|mate-panel|plasma-desktop|xfce4-panel)$/ { /(gnome-shell|gnome-panel|kicker|lxpanel|mate-panel|plasma-desktop|xfce4-panel)$/ {
# only one entry per type, can be multiple # only one entry per type, can be multiple
if ( desktops !~ $NF ) { if ( desktops !~ $NF ) {
desktops = desktops separator $NF desktops = desktops separator $NF
@ -3476,6 +3490,22 @@ get_desktop_extra_data()
eval $LOGFE eval $LOGFE
} }
get_de_gtk_data()
{
eval $LOGFS
local toolkit=''
# this is a hack, and has to be changed with every toolkit version change
toolkit=$( pkg-config --modversion gtk+-3.0 2>/dev/null )
if [[ -z $toolkit ]];then
toolkit=$( pkg-config --modversion gtk+-2.0 2>/dev/null )
fi
echo $toolkit
eval $LOGFE
}
# see which dm has started if any # see which dm has started if any
get_display_manager() get_display_manager()
{ {