A keyboard shortcut like this doesn't exist by default, but you can use the bash built-in bind
to define one.
Just add the following section to your ~/.bashrc
:
# define function that opens default FM in working directory
fmhere(){
xdg-open "$PWD"
}
# bind hotkey to it (<Alt><Shift><F>)
bind -x '"\eF":"fmhere"'
\eF
is the terminal escape sequence of my keyboard shortcut, Alt+Shift+F. Check out @slm's excellent answer over at unix.SE to learn how to determine the correct escape code for your keyboard shortcut of choice.
Another quick way to determine the escape code:
Open your terminal and press Ctrl+V. Now press your favorite keyboard shortcut. The correct escape code should appear. Just make sure to replace ^[
with \e
before adding the shortcut to your .bashrc
, e.g. replace ^[F
with \eF
.
Sources:
https://www.gnu.org/software/bash/manual/bashref.html#Bash-Builtins
https://unix.stackexchange.com/q/89622/29245
I'm using Gnome instead of Unity, but they should be the same (more or less).
Nautilus (a.k.a. Files) keeps its keyboard shortcuts in ~/.config/nautilus/accels
File Rename is listed there as:
; (gtk_accel_path "<Actions>/DirViewActions/Rename" "F2")
The ;
means that it is commented out and Nautilus uses the system default.
If you remove the ;
and change the line to:
(gtk_accel_path "<Actions>/DirViewActions/Rename" "<Primary>Return")
Then File Rename will be changed to Control-Enter
.
It seems that there is only one shortcut possible for each operation. Nautilus uses the last one listed.
So you can't have F2
and Control-Enter
at the same time.
In order for the changes to take effect you have to stop nautilus. Run the following from the commandline (before you make the change):
nautilus -q
Detailed steps (on request):
Now we have the configuration file in an editor, we have to stop Files ('Nautilus') before we can make changes. Again, two ways of doing this:
- Option 1: open a terminal window (
Gnome Terminal
) and kill nautilus, by issuing command: nautilus -q
. Your Files window(s) should all disappear
- Option 2: hit
<Alt>F2
and give command nautilus -q
. Your Files window(s) should all disappear
Now Files ('Nautilus') has been stopped, we can make changes to its configuration files.
- In the editor, make the changes as listed above and save the file
- Exit the editor
If you now open Files ('Nautilus') again, your changes should take effect
Answers to foot notes:
1. It is relevant to specify the application you're having a problem with. In this case, it was the configuration of the application as opposed to a system setting that had to be modified to resolve this issue.
2. People will know what you mean by GUI Environment
. It is however generally referred to as GUI
or Desktop
in this context.
Best Answer
It is under System Settings -> Keyboard -> Shortcuts -> Launchers, and by default on my system it is set to
Explorer
key (whatever that means), but personally i've set it to Super + E , since this is the same as Window's shortcut, which is what I used to use a lot year and half ago when I still was a Windows user. Just click on the area where the description for key is, it will saynew accelerator
and press keys you want to setAnd if you want to create a shortcut to open some directory other than home, go to Custom shortcuts, and set a new shortcut for
nautilus /path/to/dir
command. For instance,nautilus /usr/share/applications