You might remember my previous post about how to actually use the Create Document option on your desktops right-click menu. Today I’ll go over how to create custom scripts to launch from that same panel. This can go for any frequently used program, custom scripts that you’ve written, etc. This tutorial is rated E for everyone! ;)

First of all let me have you navigate to

~/.gnome2/nautilus-scripts/

Currently this folder is probably empty (if it isn’t you’ve probably already accomplished the purpose of this tutorial). This simple, seemingly insignificant folder can house any program or script you’d like to run. Below are a couple of examples of applications or scripts you could add to your nautilus right-click menu.

gedit Terminal

#!/bin/sh
gnome-terminal

Saving this file with these contents will allow you to launch a terminal in your current directory. (ie; if you launch it from the Desktop it will open a terminal in your home folder. If you launch it from within ~/.gnome2/nautilus-scripts/ it will open a terminal in that same folder.)

You will also need to set any script that you create as executable. You do that, after creating the file, by running the following command:

chmod +x [filename]

Enjoy and, as usual, enjoy your rise to world domination!

Update: There are also a few pre-made script packages that you can install for a few commonly used things. Search via Synaptic or on the command line for:

sudo aptitude search nautilus-script

technorati tags:, , , ,

If this site has been useful, please consider participating in the Fundraiser.

Other Points of Interest

  • No Related Post

Comments

7 Responses to “Right-Click to Launch Custom Scripts with Nautilus : Ubuntu (6.06.1 / 6.10)”

  1. Ulisse on December 29th, 2006 3:44 am

    You should also try Nautilus Actions[1], that is basically the same stuff but with a better and newer approach.

    [1] http://www.grumz.net/index.php?q=taxonomy/term/2/9&PHPSESSID=522bfe0c1c3ae20f36c13bbd8dfac26c

  2. Stefan on December 29th, 2006 10:36 am

    Great tutorial! It seems that Nautilus has to be restarted after adding a script in ~/.gnome2/nautilus-scripts/ in order for it to show up in the right-click menu.

  3. Marius on December 29th, 2006 11:42 am

    In my experience I never had to restart Nautilus for it to show new scripts. Just make sure the script is flagged as executable and it should show up right away.

  4. It’s just a click to the right « Re.Mark on January 18th, 2007 3:03 pm

    [...] just a click to the right January 18, 2007 Posted by remark in Open Source, Ubuntu. trackback Want to be able to launch a terminal window from the current directory in Ubuntu?  Idid.  Read this.  Problem solved. [...]

  5. nautilus-open-terminal : terminal quick launch : Ubuntu Tutorials : Breezy - Dapper - Edgy - Feisty on May 13th, 2007 9:43 am

    [...] might remember I blogged about something similar long-long ago with nautilus scripts.  This is based on the same idea, but now wrapped in a nice shiny deb package.  From the package [...]

  6. Ubuntu | Christer Edwards: nautilus-open-terminal : terminal quick launch on May 14th, 2007 6:07 pm

    [...] might remember I blogged about something similar long-long ago with nautilus scripts.  This is based on the same idea, but now wrapped in a nice shiny deb package.  From the package [...]

  7. naisioxerloro on November 28th, 2007 7:27 pm

    Hi.
    Good design, who make it?

Leave a Comment




    Subscribe to the RSS feed!


    subscribe to the ubuntu tutorials RSS feed

    Ubuntu Tutorials Fundraiser


    Please Donate to
    Server Improvement

    Target amount: USD1,000.00
    Total Donations: USD255.00
    Amount Needed: USD745.00

    Thank you for your support!

    Click to Donate

    Polls



  • Blogroll

  • Ads by Google