First, open gconf-editor and set /desktop/gnome/interface/can_change_accels
to true
. This lets you edit menu shortcuts.
Second, open a terminal and type:
killall nautilus && UBUNTU_MENUPROXY= nautilus
This will relaunch Nautilus with the standard (non-Unity) menu bar, because the Unity menu bar doesn't support this feature. (It will respect your changed shortcuts, but it won't let you change them.)
Now, open the file menu, hover the mouse over Create Document > Empty File and press your desired shortcut. Ctrl-Alt-N seems like a decent choice, or you can reassign Ctrl-N. You should see the accelerator hint change in the menu.
Finally, relaunch Nautilus without the UBUNTU_MENUPROXY
variable to get your Unity menus back with the new shortcut.
Edit: The solution for newer versions is nearly the same , except you need to use dconf-editor
instead of gconf-editor
. You can install the dconf-tools
package to get dconf-editor.
Also, the killall nautilus ...
command did not appear to be necessary.
- Run dconf-editor.
- Go to
org/gnome/desktop/interface
.
- Check the box for
can-change-accels
.
- 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.
- Don't forget to uncheck
can-change-accels
in dconf-editor after you're done.
Finally figured it out.. first sudo apt-get install dconf-tools nautilus-open-terminal
, then run dconf-editor
and set the org/gnome/desktop/interface/can-change-accels
boolean on. Then open nautilus using this command (to disable Unity global menu Temporarily):
nautilus -q
UBUNTU_MENUPROXY=0 nautilus
Now you can mouseover the action in the file menu, and change the accel by typing your key while the action is highlighted, finally restart your nautilus. If you don't see Open in terminal in the File menu and you've just installed nautilus-open-terminal
, you might need to first run nautilus -q
.
![enter image description here](https://i.stack.imgur.com/2cTie.png)
![enter image description here](https://i.stack.imgur.com/bMdqD.png)
Ubuntu 14.04 and up
If you can't find the can-change-accels
key in your dconf configuration you can try the following solution:
- Stop nautilus by executing
nautilus -q
Open ~/.config/nautilus/accels
in a text editor of your choice, e.g. gedit:
gedit ~/.config/nautilus/accels
Try to see if you can find the following line:
;(gtk_accel_path "<Actions>/DirViewActions/OpenInTerminal" "")
If the line exists, add your keyboard shortcut in the second double-quoted segment and uncomment the line by removing ;
:
(gtk_accel_path "<Actions>/DirViewActions/OpenInTerminal" "F12")
This would set the shortcut to F12. For a list of all possible key codes please consult this answer.
If the line doesn't exist just copy and paste the one found in this answer at the end of the file.
Save the file and restart Nautilus by clicking on the Nautilus icon in your launcher/dash.
Ubuntu 15.10 and 16.04
Here, the relevant command in ~/.config/nautilus/accels
is TerminalNautilus:OpenFolderLocal
. (NautilusOpenTerminal::open_terminal
is still present in the file, but doesn't seem to have any effect.) So follow the instructions above, except change the line
; (gtk_accel_path "<Actions>/ExtensionsMenuGroup/TerminalNautilus:OpenFolderLocal" "")
to
(gtk_accel_path "<Actions>/ExtensionsMenuGroup/TerminalNautilus:OpenFolderLocal" "F12")
to make F12 your keyboard shortcut. Notice that ;
is again removed.
Finally, log out for changes to take effect.
Best Answer
tl;tr You already found the answer it just needs some affection.
So just repeat it, click around and restart nautilus/relog/reboot until it starts working.
I wasn't aware that this is possible but now after reading your question I was intrigued.
So long story short: it's a bug. Its on GitLab and also on BugZilla.
Fortunately, custom scripts still work and you already found the answer for those. However, as you described, following the steps provided did not work - likely another bug.
After fiddling around for half an hour I got it working:
Follow the steps from the linked answer:
create file
Terminal
in~/.local/share/nautilus/scripts
with content:make it executable
chmod +x ~/.local/share/nautilus/scripts/Terminal
F4 Terminal
to~/.config/nautilus/scripts-accels
(or some other key)nautilus -q
or log out and log in again (to be sure)Open Natilus
Press F4 (nothing happens)
Right click a folder, select
Scripts
>Terminal
-> Go back to NautilusPress F4 again - it will work as expected.
Expected result should look like this (just in your default language):