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.

While I have a nautilus window open I can do Ctrl+Shift+N to create a new folder in the current directory. However there is no default keyboard shortcut for creating a new document. How would I create one?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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. I had to install dconf-editor, 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
    
killall nautilus && UBUNTU_MENUPROXY= nautilus that for some reason did not relaunch nautilus with non-unity menu bar for me. I had to login in classic mode. But worked. :) –  Shafee Jul 15 '11 at 19:52
    
is it possible via a single bash script? –  disfated Jan 7 '12 at 22:27
    
Anyway to do this in 12.04? I'm getting stuck at step two. No process named nautilus is found. –  Kelbizzle Aug 6 '12 at 7:19
    
For 12.04 see my answer here: askubuntu.com/q/88010 –  stevelove Aug 7 '12 at 1:51
    
Appreciate the edit, however if you are using unity, I think it's still necessary to relaunch nautilus with the global menu bar disabled: the hover-and-press-shortcut behaviour doesn't work on the unity menus. –  cscarney Mar 13 '13 at 3:07
add comment

Open terminal:gconf-editor

go to

/apps/metacity/keybinding_commands

find unassigned command e.g. command_1

double click on value and type /usr/bin/gedit

next step go to

/apps/metacity/global_keybindings

select run_command_1 (in this example) , double click on the value and set the preferred shortcut

Logout/Login from/to system

share|improve this answer
    
wouldnt this simply open Gedit? –  Shafee Jul 15 '11 at 19:43
    
this will open new document with gedit, the document must be saved after finishing of work –  petrakis Jul 15 '11 at 19:48
    
not what i wanted. thank a bunch though. –  Shafee Jul 15 '11 at 19:54
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.