Add a quick-access shortcuts to the GNOME right-click menu - gHacks Tech News

Add a quick-access shortcuts to the GNOME right-click menu

I use the terminal A LOT. Why? Because I'm an old-school Linux user. Because of this I like to have multiple ways to quickly access my terminal. In my never-ending search for more and more ways to make my desktop life easier, I came across a nifty way to add a program shortcut to the right-click desktop menu in the GNOME desktop environment.

This shortcut is actually the Location Context Menu in the Nautilus Actions tool. Thanks to that little feature you can create plenty of quick-access shortcuts which will start up those applications from the right-click menu. Let's see how this is done.

Nautilus Actions Configuration

I have covered this topic before (see Nautilus Actions content on Ghacks) on Ghacks, so the idea of creating a Nautilus Action should be familiar. In case you haven't read any of the other content, the idea behind Nautilus Actions is that you can create an action, based on location and/or MIME type. These actions are highly customizable and incredibly handy to use.

Usually these actions are created not only with the command to be executed, but with command parameters that are used to inform the command what it is acting on (for example: %M for space-separated list of full pathnames for selected files). We are going to NOT add parameters for any actions we create for the purpose of command shortcuts. Why? Because for the shortcut you are not going to be acting on any file or directory, it is just to start an application.

Create the action

Click on System > Preferences > Nautilus Actions Configuration. This will start up the Nautilus Actions Configuration window. Let's say you want to create a short cut used to open the GNOME Terminal application. Here are the steps you need to use to do that:

  1. Click the "Define a new action" button.
  2. In the Action tab make sure you check the box for "Display item in location context menu" and enter "GNOME Terminal" in the Context Label area.
  3. In the Command tab enter /usr/bin/gnome-terminal for the Command Path. Do not enter anything for the Parameters.
  4. Click the Save button.

Your action has been created. Now, to make sure it will appear, you need to restart Nautilus. To do this you can either log out and log back in or you can open up a terminal window and issue the command nautilus -q.

Figure 1

After Nautilus has restarted right-click anywhere on your desktop and you should see an entry in your menu that looks like that shown in Figure 1.

Of course you can do this with just about any application you want. But know that this really wasn't the intended use of this tool...but it is a handy way to create those shortcuts.

You could get very creative with this set up and create shortcuts for various commands and actions.

Final thoughts

One of the aspects of the Enlightenment desktop that I've always like was the ability to quickly access applications from a simple click of the mouse anywhere on the desktop. This little "shortcut" on GNOME will give you a similar feature.





  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. hrhnick said on November 30, 2010 at 3:38 am
      Reply

      Although the scope was to add programs to the context menu, a better way to add a terminal shortcut is through the “nautilus-open-terminal” package which lets you open files and folders directly in terminal.

    2. thameera said on December 1, 2010 at 7:18 pm
      Reply

      Thanks, worked great. Didn’t require a nautilus restart.

    Leave a Reply