Debugging File Type (MIME) Associations

I’m having less and less time to blog and write stuff lately, so it’s a good opportunity to catch up with old things I did. Back in the happy days when I used Gentoo, one of the irritating issues I faced was messed-up file type associations. The MIME type for some files was recognized incorrectly, and as a result, KDE offered to open files with unsuitable applications. In order to debug it, I wrote a small Python script that would help me debug the way KDE applications are associated with MIME types and what MIME type is inferred from each file.

The script does so by querying KMimeType and KMimeTypeTrader. The script does 3 things:

  • Given a MIME type, show its hierarchy and a list of applications associated with it.
  • Given an application, list all MIME types it’s associated with.
  • Given a file, show its MIME type (and also the accuracy, which allows one to know why that MIME type was selected, although I admit that in the two years since I wrote it, I forgot how it works :))

The script is pasted below. I hope someone who still fiddles with less-than-standard installations will find it helpful.
Continue reading Debugging File Type (MIME) Associations

Disable Touchpad Tapping in Kubuntu

In Ubuntu (GNOME), there is an easy graphical way to disable tapping on the touchpad. However, KDE lacks such a thing. But lacking a graphical configuration tool doesn’t mean this should be difficult. All you need is the gsynaptics package. The package provides a small utility called synclient. Now you can disable tapping by doing

 synclient TapButton1=0

To disable tapping permanently, you should use the following to run the command at the start of every KDE session.

echo "synclient TapButton1=0" > ~/.kde/env/disable-tapping.sh

Upgrading All KDE-Related Packages in Gentoo

Yesterday, Gentoo marked KDE 3.5.10 as stable on amd64. I looked for a way to upgrade all of the KDE-related packages without manually specifying each one of them. Normally, one could do

emerge -avu world

but I encountered some nasty conflicts that I didn’t have time, nor would I, to resolve at that time. So I looked for a different solution. To my rescue came qlist from the great app-portage/portage-utils package. This package provides a set of very fast utilities to query portage. I used qlist to list all of my installed packages, grep‘ed the list, and piped the result as arguments to emerge using xargs.
Continue reading Upgrading All KDE-Related Packages in Gentoo