8

I want to assign some shortcuts to menu actions in Nautilus 3.2.1 running under Ubuntu 11.10. I followed the steps shown here How do you create a "new document" keyboard shortcut? but it did not work for me. Switched to gnome classic so I can get the normal menu, hovered over the desired action pressed the desired keys but nothing happened (restarted nautilus, re-logged and nothing).

Any suggestions or ideas on how to assign custom shortcuts to actions in Nautilus 3

1
  • It works for me..
    – wim
    May 8, 2012 at 13:43

6 Answers 6

10
+50

The solution is nearly the same as the answer in the question you linked to, except you need to use dconf-editor instead of gconf-editor. I had to install dconf-editor, which if I remember correctly, comes with the dconf-tools package. Also, the killall nautilus ... command did not appear to be necessary.

So, once you've got dconf-editor, run it.

  1. Go to org/gnome/desktop/interface.
  2. Check the box for can-change-accels.
  3. Open Nautilus and highlight the menu item whose key binding you want to change, either with your mouse or via the keyboard, and press the key(s) you want to use as the shortcut.
  4. Don't forget to uncheck can-change-accels in dconf-editor after you're done.
2
3

I use a little extended workaround.

  1. Open dconf-editor. Find org > gnome > desktop > interface and check can-change-accels option.
  2. Open ~/.gnome2/accels/ folder. Here you should see a file named nautilus. It contains all available nautilus actions you can assign an accel to.
  3. Edit this file, save and close.

    eg: I transformed the following line

    ; (gtk_accel_path "<Actions>/ExtensionsMenuGroup/NautilusOpenTerminal::open_terminal" "")
    

    into

    (gtk_accel_path "<Actions>/ExtensionsMenuGroup/NautilusOpenTerminal::open_terminal" "<Alt>t")
    

    and now I am able to open terminal in current directory by pressing <Alt>t.

  4. Uncheck can-change-accels.
  5. Restart nautilus.

    pkill nautilus && nautilus
    
1
  • 1
    Modifying ~/.gnome2/accels/ works for me without having to set can-change-accels first. Apr 1, 2013 at 14:32
2

It's due to the presence of the global menu?

Yes. You can set the keys by launching apps without global menu UBUNTU_MENUPROXY=0 gedit

Once set, it will work with the global menu.

1

Checkout this answer, "Another way to define arbitrary hot keys" .

I downloaded that python script from here(git repo) and changed the keyboard settings to my liking (I don't like overriding F6 , F5 and Ctrl + O as the author has done in his proof of concept).

This is the only thing that is working for me in Nautilus, as far as changing/adding keyboard shortcuts is concerned. dconf-editor or gconf-editor change accel just doesn't work.

I am on Ubuntu Unity and not using Gnome Classic etc, and I hope you too are on the same boat. Of course, I have installed a bunch of stuff on top of that ( protoiyer.github.com "Setting up my linux box and ruby on rails" ) to tweak Ubuntu/Unity, and so not sure whether any of it is screwing up with the dconf-editor setting.

It would be great if we can understand why it is working for @wim :).

1
  • 1
    I can't comment under user55822's reply (may be since I am a new member to this community), hence replying here: I tried with global menu disabled and it allowed me to set new shortcuts, and I was happy for a few moments. When I closed the nautilus window and then restarted it (nautilus -q && nautilus) I find that all my newly baked in shortcuts are gone. Looks like the shortcuts you set are not persisted when you go back to use global menu. I am now back to using my python script.
    – Proto
    May 12, 2012 at 6:16
1

Since 3.15 it is not possible to use the accel file anymore, but it is possible to rebind keys by utilizing python-nautilus. Similar to an answer above I use a python script to rebind the keys.

Here is a good explanation of how to do it. If the folder and file don't exist, you can simply create them and it works just fine.

https://wiki.archlinux.org/index.php/GNOME/Tips_and_tricks#Modify_Nautilus_Hotkeys

1
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Sep 9, 2020 at 23:55
0

This extension allows you to assign keyboard shortcuts (accelerators) to various menu actions:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .