16

How can I set a shortcut for open terminal in current directory for nautilus?

I'm using Nautilus 3.16.2 and I already tried this answer but look like it's broken in newer version.

1

3 Answers 3

24

I added a new feature to Nautilus with the precious help of the maintainers.

This new feature allow you to map custom keyboard shortcuts to launch the scripts in the scripts folder ( ~/.local/share/nautilus/scripts ).

So, when you add an executable in that folder it will appear in the right-click context menu, but now if you create a special configuration file ( ~/.config/nautilus/scripts-accels ) you can assign a shortcut to it.

For example make a script called Terminal with the following content:

#! /bin/sh
gnome-terminal

Now create (or edit) the ~/.config/nautilus/scripts-accels file adding the following lines:

F4 Terminal

; Commented lines must have a space after the semicolon
; Examples of other key combinations:
; <Control>F12 Terminal
; <Alt>F12 Terminal
; <Shift>F12 Terminal

Restart Nautilus (nautilus -q) and when you'll press F4 key you'll open a new terminal window in the current directory (feel free to create a new key combination following the commented lines examples).

Note: if you select one or more files, their names will be passed as parameters to the executable. Your script can also have access to many information through environment variables.

Link of the commit: https://git.gnome.org/browse/nautilus/commit/?id=9fe1335

There is also a gui to manage these shortcuts: https://github.com/echo-devim/nautilusaccelsmanager

8
  • I already installed nautilus 3.18.2 but this method not works for me. Is it need to compile the commit source? From which version it pushed to master?
    – user41209
    Nov 15, 2015 at 16:27
  • The commit is already pushed in the master branch. You should download and compile the latest source code from the official site, because probably this patch will be included in the next release.
    – RobotMan
    Nov 16, 2015 at 20:19
  • 1
    This method works with 3.28.1.
    – orschiro
    Jul 18, 2018 at 11:14
  • 2
    Make sure you provide executable permissions to the Terminal script. chmod +x ~/.local/share/nautilus/scripts/Terminal. See here: askubuntu.com/a/1062263/775359 May 30, 2019 at 9:01
  • 1
    Successfully tested on Ubuntu 20.04 LTS! 🎉
    – Salim B
    May 8, 2020 at 16:14
5

According to News file inside nautilus git repository, since version 3.15.4 accells not loaded any more

Major changes in 3.15.4:
* Stop loading custom accel maps file

Fortunately for nautilus >= 3.20 "RobotMan" answer solved the problem.

1
  • Its 2022. I switched to the Thunar and god it's awesome. Packed with nice GUI to easily map any script to any key binding with tons of other cool features and options. Still Nautilus stick to it's shitty search UX, hard way to set shortcut and very bad keyboard focus handling.
    – user41209
    Mar 29, 2022 at 4:55
2

2020
One option is to use:
Ctrl + F10 then e

Ctrl + F10: Same as right click at the current folder
e: Selects "Open in Terminal"

This is my favorite because you don't have to change any settings


It can change if your OS is in another language.
For example, in portuguese from brasil would be:
Ctrl + F10 then t
Just look at the underlined letter to know the key.


If you are using notebook you may have to use the super key too.
Ctrl + Super + F10 then e

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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