nfx_logo
Home About Downloads Tutorials

Tutorial: Linux scene file associations

This tutorial will show you how to associate Nuke scene files in Linux so that when you double click a .nk file Nuke will open the scene file.

Even though you can right click on a file and set the "Open with" options this method allows you to use the Nuke icons for scene files along with setting up the "Open with" options.

The file you want to look foor is Override.xml which is located in $HOME/.local/share/mime/packages. If this file does not exist then go ahead and manually create it, the example for this tutorial will demonstrate starting with a blank Override.xml file. Here is what a blank Override.xml file should look like with the lines added for Nuke.
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-nuke"><comment>Nuke scene</comment><glob pattern="*.nk"/>
<sub-class-of type="text/plain"/></mime-type>
<mime-type type="application/x-nuke"><comment>Nuke scene</comment><glob pattern="*.nk.autosave"/>
<sub-class-of type="text/plain"/></mime-type>
</mime-info>

After you are done editing the Overrides.xml file you need to refresh your mime database, open up a terminal and execute the following command.

update-mime-database ~/.local/share/mime

If all goes well then nothing should print out after you execute the above command, if however you messed something up you will get errors.


Last last step is adding an icon for the Nuke .nk scene files for when your browsing folders. I use the Tango icon theme but this will be the same regardless of whatever theme you use.


First thing you will want to do is grab the png file from your Nuke install directory that is for Nuke .nk scene files. Browse to your Nuke directory /usr/local/Nuke4.7v2/plugins/icons and copy the file NukeScript32.png. With the copied png file navigate to your $HOME/.icons directory. Since I use the Tango icon theme and they are located in /usr/share/icons I had to create a folder Tango inside $HOME/.icons to store the png file. Under your icon theme folder you should have two directories 32x32 and mimetypes, if you do not have them simply create the directories and place the mimetypes32x32. Now take our png file NukeScript32.png and place it in ../32x32/mimetypes, the final step is to then rename our Nuke png icon to gnome-mime-application-x-nuke.png.


And now we have pretty Nuke icons for .nk and .nk.autosave files,

© 2007 NFXPlugins All rights reserved - Nuke is a trademark of The Foundry Visionmongers Ltd.