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.

Pandu
  • 143
  • 5

1 Answers1

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
Glutanimate
  • 21,393