I copied this from "RobotMan" on http://askubuntu.com/a/696901
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 line:
F4 Terminal
Restart Nautilus and when you'll press F4 key you'll open a new terminal window in the current directory.
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
I tried the trick you suggested above but when folders contain spaces it doesn't work. It just opens the terminal into the last folder in the path not having spaces. Moreover if I select more than one file it just don't do any action.