1

Is there a way to do this? Whether by a keyboard shortcut or a context menu item or something?

Note: I specifically mean "close Nautilus" -- this works for opening a terminal without closing Nautilus.

1 Answer 1

1

You could use a Nautilus script for this:

#!/bin/bash

# Simple Nautilus script that closes current Nautilus view and opens terminal in
# working directory
# 
# Dependencies: xdotool
# 
# See here for installation instructions:
# https://askubuntu.com/q/236414/81372

# Store working directory
WorkingDir="$(python -c 'import gio,sys; print(gio.File(sys.argv[1]).get_path())'\
  "$NAUTILUS_SCRIPT_CURRENT_URI")"
# Close Nautilus window
xdotool key --clearmodifiers "alt+F4"
# Open terminal
gnome-terminal --working-directory="$WorkingDir"

Installation instructions for Nautilus scripts and setting up a hotkey may be found here.

The only dependency is xdotool, which you can easily install with:

sudo apt-get install xdotool

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .