Added MATE desktop support, same method as cinnamon, xprop shows the string _MARCO which is the renamed metacity window manager.

Then mate-about -v gives the current mate version.

New inxi, 1.8.17, new tarball.
This commit is contained in:
inxi-svn 2012-09-17 00:47:08 +00:00
parent a5731b47b5
commit c7d6a07719

27
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.8.16 #### version: 1.8.17
#### Date: September 16 2012 #### Date: September 16 2012
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
@ -3256,7 +3256,9 @@ get_desktop_environment()
# note that cinnamon split from gnome, and and can now be id'ed via xprop, # 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 # 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 # eventually this needs to be better organized so all the xprop tests are in the same
# section, but this is good enough for now.
if [[ -n $xprop_root && -n $( grep -is '^_MUFFIN' <<< "$xprop_root" ) ]];then
version=$( get_de_app_version 'cinnamon' '^cinnamon' '2' ) version=$( get_de_app_version 'cinnamon' '^cinnamon' '2' )
# not certain cinn will always have version, so keep output right if not # not certain cinn will always have version, so keep output right if not
if [[ -n $version ]];then if [[ -n $version ]];then
@ -3269,6 +3271,19 @@ get_desktop_environment()
fi fi
fi fi
desktop_environment="Cinnamon" desktop_environment="Cinnamon"
elif [[ -n $xprop_root && -n $( grep -is '^_MARCO' <<< "$xprop_root" ) ]];then
version=$( get_de_app_version 'mate-about' '^MATE[[:space:]]DESKTOP' 'NF' )
# not certain cinn/mate 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="MATE"
# 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
elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then
@ -3434,8 +3449,9 @@ get_de_app_version()
{ {
local version_data='' version='' get_version='--version' local version_data='' version='' get_version='--version'
# mate-about -v = MATE Desktop Environment 1.4.0
case $1 in case $1 in
dwm|jwm|wmii) dwm|jwm|mate-about|wmii)
get_version='-v' get_version='-v'
;; ;;
esac esac
@ -3497,7 +3513,10 @@ get_de_gtk_data()
local toolkit='' local toolkit=''
# this is a hack, and has to be changed with every toolkit version change # this is a hack, and has to be changed with every toolkit version change
toolkit=$( pkg-config --modversion gtk+-3.0 2>/dev/null ) toolkit=$( pkg-config --modversion gtk+-4.0 2>/dev/null )
if [[ -z $toolkit ]];then
toolkit=$( pkg-config --modversion gtk+-3.0 2>/dev/null )
fi
if [[ -z $toolkit ]];then if [[ -z $toolkit ]];then
toolkit=$( pkg-config --modversion gtk+-2.0 2>/dev/null ) toolkit=$( pkg-config --modversion gtk+-2.0 2>/dev/null )
fi fi