Random Bits

Random Bits

  • Home
  • Contact

Making KDE Play Nice on a GNOME Desktop

I prefer GNOME for the most part, but some KDE applications are simply better than their GNOME counterparts. That said, there are some problems getting them to work well together. I recently discovered that installing k3b cause my GNOME menus to, for lack of a better word, explode. Here’s how I went about fixing them.

First, to give you some idea of what I mean by explode, take a look at this:

KDE explosion in the GNOME menus

KDE explosion in the GNOME menus

All of that comes from installing k3b. The problem is that KDE doesn’t honor the freedesktop.org Desktop Menu Specification. Specifically, KDE should be putting OnlyShowIn entries into their .desktop files that shouldn’t be displayed in GNOME. This isn’t exactly a new problem. Given the fact that kicker bug #63933 was logged in 2003 and still isn’t fixed, I figured I’d have to fix it myself.

Here’s my solution. For each .desktop file in each package specified, this script will add OnlyShowIn=KDE if it isn’t already present.

#!/bin/bash

package_list="kamera kcontrol kdebase-data kdebase-kio-plugins \
              kdemultimedia-kio-plugins libkcddb1"

for package in $package_list; do
    for desktop_file in `dpkg -L $package | grep 'applications/.*\.desktop'`; do
        count=`grep -c -i OnlyShowIn $desktop_file`
        if [ $count -eq 0 ]; then
            echo "Modifying $package: $desktop_file"
            echo 'OnlyShowIn=KDE;' >> $desktop_file
        fi
    done
done

It needs to be run with sudo or as root since it’s modifying system files. Also, the list of packages I provided are not comprehensive. They’re simply the ones that I noticed didn’t honor the specification. If you aren’t using Debian or Ubuntu, you’ll have to modify the dpkg command to the equivalent rpm command.

Related Posts:

  • Fixing uTorrent File Associations in Linux

    Running uTorrent under wine works pretty well in Linux. For...

  • Monitoring a UPS with nut on Debian or Ubuntu Linux

    There are two different ways to monitor a UPS with...

  • RealPlayer on x86_64 (amd64) Debian Linux

    There are a few tricks to getting RealPlayer to work...

  • Updated awstats for Debian

    The awstats package in Debian is pretty outdated. Etch has...

Sponsored Links:

This entry was posted on Wednesday, July 30th, 2008 at 9:07 PM and is filed under Linux. You can leave a response, or trackback from your own site.

Leave a Reply

Click here to cancel reply.

  • Topics

    • Personal (1)
    • Technology (13)
      • Linux (11)
      • Web (4)
  • Archives

    • April 2009
    • March 2009
    • January 2009
    • December 2008
    • August 2008
    • July 2008
  • Meta

    • Register
    • Log in
    • Valid XHTML

Feed | Privacy Policy
Copyright © 2008-2009 Random Bits
Powered by Wordpress