But I guess that’s what the OP meant - without knowing that /usr/bin/package-manager (the program which is run when you choose “Install/Remove Software”) is in fact a wrapper script to YaST package management. So - if the developpers were coherent - this solution should work.
/usr/bin/package-manager checks for the presence of kpackagekit or gnome-packagekit - which is OK - but also compares the value of WINDOWMANAGER with ‘/usr/bin/gnome’. IMO this variable is not reliable, as it can be set by the user to a value that package-manager doesn’t expect. That’s actually the problem here with ‘mate’. When I use gnome-fallback, my WINDOWMAGER says ‘metacity’. When I use gnome-shell, it says ‘mutter’ … When I use cinnamon, it says ‘cinnamon’ - it should actually say ‘muffin’, but it doesn’t matter, since I use ‘muffin’ only with ‘cinnamon’. Anyway, it should check the value of DESKTOP_SESSION instead and include ‘mate’ in its test.
Further, even if it sets the method to gnome-packagekit, it doesn’t set the interface to ‘gtk’. That’s because - I guess - the openSUSE team wants to set the default interface somewhere else, indeed in /etc/sysconfig/yast2 - as already mentioned.
Another approach would be to set the interface to qt for kde, gtk for gnome - including fallback, cinnamon and mate. But notice that YaST uses GTK3, and mate is based on GTK2. You still need to have GTK3 and a GTK3 theme installed to use the gtk interface under ‘pure’ mate desktop.
Here’s the changes I made to /usr/bin/package-manager - after reading this thread. I was wondering why it uses the qt interface under cinnamon and found it annoying too.
--- package-manager.orig 2012-11-24 22:45:49.805751761 -0800
+++ package-manager 2012-11-25 00:01:34.263052041 -0800
@@ -102,7 +102,7 @@
# determine what we can use
if $HAVE_KPACKAGEKIT && "$KDE_FULL_SESSION" ]; then
METHOD=kpackagekit
-elif $HAVE_GPACKAGEKIT && "$WINDOWMANAGER" == "/usr/bin/gnome" ]; then
+elif $HAVE_GPACKAGEKIT && "$DESKTOP_SESSION" == "gnome-shell" -o "$DESKTOP_SESSION" == "gnome-fallback" -o "$DESKTOP_SESSION" == "cinnamon" -o "$DESKTOP_SESSION" == "mate" ]; then
METHOD=gnome-packagekit
else
if "$STACK" == "zlm" ]; then
@@ -164,14 +164,14 @@
;;
kpackagekit)
if $# == 0 ]; then
- xsu /sbin/yast2 --install
+ xsu /sbin/yast2 --qt --install
else
kpackagekit "$@"
fi
;;
gnome-packagekit)
if $# == 0 ]; then
- xsu /sbin/yast2 --install
+ xsu /sbin/yast2 --gtk --install
else
/usr/bin/gpk-install-local-file "$@"
fi
- I don’t have ‘mate’ under openSUSE, but I checked the value of DESKTOP_SESSION under Linux Mint, and it should be ‘mate’. I presume it will be the same in openSUSE.
I posted this patch here for educational purpose. Most users won’t need it. It only makes sense if you switch between KDE and Gnome and want to use the qt interface under KDE and the gtk interface under Gnome - and use the wrapper script to start the YaST package management module. Otherwise the following commands will do fine as well:
$ gnomesu -c '/sbin/yast2 --gtk --install'
$ gnomesu -c '/sbin/yast2 --qt --install'
or
$ gnomesu -c '/sbin/yast2 --gtk sw_single'
$ gnomesu -c '/sbin/yast2 --qt sw_single'
Whether gnomesu, kdesu or xdg-su is installed is determined by another script: /usr/bin/package-manager-su - when you use the package-manager wrapper.
detectDE()
{
if x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
elif x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
fi
}
You might have to add a DESKTOP_SESSION value here for mate too. I’m not sure mate uses GNOME_DESKTOP_SESSION_ID (maybe MATE_DESKTOP_SESSION_ID). I didn’t use GNOME_DESKTOP_SESSION_ID in my patch, because it is supposed to be deprecated.
- I’m aware that my post might actually look more complicated than the OP expected.