0

While the command line is very useful for most of the tasks, I sometimes resort to a graphical file explorer (like Nautilus, Thunar, PCmanFM). I would like a keyboard shortcut or a context-menu entry to open such a graphical file explorer _in the current directory. I know the converse is possible with nautilus-open-terminal. Is there currently a way to do that?

It may require writing a perl-extension, but I do not know enough of perl and urxvt to find how to capture the current PWD.

2 Answers2

1

Assuming you're using Bash as your shell, here's an alias you could add to your .bashrc:

alias nh="nautilus file://$(pwd)"

I called it nh for "Nautilus here". So from the comman-line you would simply type:

nh

for a nautilus window in the shell's current directory.

I have no idea what's involved in adding something to the urxvt context menu - sorry.

Grant McLean
  • 6,898
  • 1
  • 21
  • 37
  • Yes, thanks for the idea! However, and I should have added that in the question, my idea is to not "disturb" the current shell session by launching a tied command inside (if I close the term, Nautilus would close too). – raphaelfournier Oct 18 '18 at 22:09
  • Are you sure about that? If run `nautilus` from the command-line in a `gnome-terminal` window, it fires up an entirely independent file manager window - which continues to run if I close the terminal. If `urxvt` doesn't do that for you, then you can probably workaround it by using `nohup` in the alias. – Grant McLean Oct 18 '18 at 22:49
0

Well, I quickly hacked a small extension to do this: https://github.com/raphaelfournier/urxvt-perl.

The opening of the file browser can be triggered with the right-click menu or a keyboard shortcut. The selection can be a directory, but also a filename, which will then be opened by the application associated with it in the file browser.