Sunday, May 18, 2008

Controlling file associations in Gnome

Gnome, whether under redhat or ubuntu, is very hard to configure. Especially controlling the behaviour when you double-click on a file. However I may've got it cracked.

First, the easy way, is right-click a file, choose properties, and there is the open with tab. The setting there affects all files with that extension. (I still think that is one of those things that isn't even obvious once you know about it!)

But sometimes that is not enough. E.g. *.as files were associated with x-applix-spreadsheet, instead of my text editor. And then it then complains I'm trying to open a suspicious file.

Solution: I created this xml file as

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="">
<mime-type type="application/x-actionscript">
<glob pattern="*.as">

Wow, that seemed to do the job!

1 comment:

Unknown said...

In Ibex you need to close glob the tag with a /> and then run 'sudo update-mime-library /usr/share/mime' for the changes to take effect.

I picked up an actionscript language file for gedit over here: he has a language file for mxml also :)

Make sure the mime types match, your mime type is 'application/x-actionscript' and the language file is 'text/x-actionscript'. Once you change them to match then gedit hilights the actionscript within your mxml also :)