Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
    
It works for me.. –  wim May 8 '12 at 13:43
add comment

5 Answers

up vote 7 down vote accepted
+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.
share|improve this answer
add comment

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
    
share|improve this answer
1  
Modifying ~/.gnome2/accels/ works for me without having to set can-change-accels first. –  Glutanimate Apr 1 '13 at 14:32
add comment

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.

share|improve this answer
add comment

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 :).

share|improve this answer
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 '12 at 6:16
add comment

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

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.