Monday, August 3, 2009

Adding Document templates to Nautilus right click menu

Ubuntu distribution uses nautilus as the default file manager. You can tweak nautilus to increase your productivity. Here is one hack which I discovered recently. When you right click on the desktop or inside your file manager you get a menu as shown in the screen shot below.

It allows you to create an empty document in your current location. The file created will be a text file. It is possible to create other kinds of file by a simple hack. Suppose you want to add an invoice template to the menu. Create an invoice template file in your favourite application ,say in open office spread sheet. Let us call the file as invoice.odt.

Copy invoice.odt to ~/Templates directory . ( Templates directory will be automatically created under your home folder in Ubuntu)
$ cp invoice.odt ~/Templates

Now see the right click menu. It will look like the screen below.

You can add as many templates as you like . Also, it is possible to group together templates by creating folders under ~/Templates directory. See the figure below. I have some groupings inside my template directory.


Anonymous said...

It's not a hack, it's a feature. And it's a pretty useful feature too. You can also change the location of your templates directory if you don't want to have a ~/Templates directory by editing ~/.config/user-dirs.dirs

Anonymous said...

I didn't know about the Templates functionality until I read your post. Now I have a fun project for the weekend. Thank you :)

Colar said...

Since I like to have a clean home : after you added all your templates, create a file named .hidden in your home directory and write in it "Templates".

F5 and the folder has disappear. CTRL H to display again your hidden files if you want to add another template.

And in french, the name for "Templates" is « Modèles ».

My 2 cents ;)

Anonymous said...

tried this in Hardy and didn't work. Any ideas? maybe this only works in 9.04???