KDE and Gnome

John L Fjellstad john-ubuntu at fjellstad.org
Sat Nov 17 13:12:01 UTC 2007


Alain Muls <alain.muls at telenet.be> writes:

> Hi,
>
> I like both KDE and Gnome, each has its avantages and disavantages.
>
> I would like to install them both, but I do not want gnome
> applications to be added to the KDE menu or vice versa. Is there a way
> to do this? Can I backup the KDE or Gnome menu and restore it after
> dpkg has finished installing the other desktop?

You need to add OnlyShowIn=GNOME (for gnome only menu items), and
OnlyShowIn=KDE (for KDE only menu items).  The files are in
/usr/share/applications. 

Or you can use the following scripts:
############# gnomemenu.sh ################
#!/bin/bash

pushd /usr/share/applications
for file in *.desktop; do
        echo $file | grep -q wireshark
        if [ $? -eq 0 ]; then
                continue
        fi
        echo $file | grep -q ^gnome
        if [ $? -eq 0 ]; then
                grep -q OnlyShowIn=GNOME $file
                if [ $? -eq 1 ]; then
                        sudo su -c "echo 'OnlyShowIn=GNOME' >> $file"
                fi
        fi
        grep Categories $file | grep -q GNOME
        if [ $? -eq 0 ]; then
                grep -q OnlyShowIn=GNOME $file
                if [ $? -eq 1 ]; then
                        sudo su -c "echo 'OnlyShowIn=GNOME' >> $file"
                fi
        fi
        grep -q X-GNOME-Bugzilla $file
        if [ $? -eq 0 ]; then
                grep -q OnlyShowIn=GNOME $file
                if [ $? -eq 1 ]; then
                        sudo su -c "echo 'OnlyShowIn=GNOME' >> $file"
                fi
        fi
done
popd
#############

############# kdemenu.sh #################
#!/bin/bash

pushd /usr/share/applications/kde
for file in *.desktop; do
        grep -q OnlyShowIn=KDE $file
        if [ $? -eq 1 ]; then
                sudo su -c "echo 'OnlyShowIn=KDE' >> $file"
        fi
done
popd
############

-- 
John L. Fjellstad
web: http://www.fjellstad.org/          Quis custodiet ipsos custodes





More information about the ubuntu-users mailing list