Ubuntu – How to create keyboard shortcuts for the nautilus scripts

11.10gnomenautilusshortcut-keys

In Ubuntu I can create handy nautilus scripts by putting .sh files into ~/.gnome2/nautilus-scripts directory, and they will appear in the right click context menu in nautilus. In 11.04, I used to be able to assign keyboard shortcuts for my scripts by editing in the file ~/.gnome2/accels/nautilus, but now in 11.10 this file is no longer there to edit. So how can I create keyboard shortcuts for my nautilus-scripts?

Best Answer

  1. Open gconf-editor and set /desktop/gnome/interface/can_change_accels to true. This lets you edit menu shortcuts.
  2. With Nautilus open, go to File menu, then Scripts, then hover over the Script you want to make a shortcut for.
  3. Press the key combination you want to assign to this Script. You should see it appear on the menu.
  4. Navigate off the menu and test it out.

You need to do this from the File menu of Nautilus...simply right-clicking in a Window to obtain the Scripts list does not allow adding shortcuts.

If you want to remove the shortcut, repeat steps 1 and 2, then press Backspace when your Script is highlighted on the menu. This should remove the shortcut.

Note: you might have to do a "nautilus -q" from Terminal before the gconf change takes effect.