Change terminal-emulator in ubuntu default filemanager

The option to open a terminal by right-clicking a file in nautilus is provided by a nautilus extension. That extension, unfortunately, is hard coded to work with gnome-terminal.

You can install an extension, nautilus-open-any-terminal, that allows to select a terminal of choice to be used for the "Open terminal here" option. As a very valuable added bonus, it also allows you to set a shortcut key to open a terminal in the current directory. Yes, you may feel that I use the extension myself, even if it is for gnome-terminal.

Removing the default extension

Remove the default extension with the command:

sudo apt remove nautilus-extension-gnome-terminal

This is the name as of Ubuntu 21.10. In older versions, the package was named nautilus-open-terminal.

Installing the python extension gnome-open-terminal

Install the dependency:

sudo apt install python-nautilus

Then install the extension

pip3 install --user nautilus-open-any-terminal

Then run the following command to allow configuring the extension using dconf:

glib-compile-schemas ~/.local/share/glib-2.0/schemas/

Configuring

Set your preferred terminal using a command like the following (example for alacritty, see on the extension's website for the list of supported terminals):

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal alacritty

To set the shortcut key for opening the terminal:

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal keybindings '<Ctrl><Alt>t'

If your terminal supports tabs, and you want the new terminal opened as a new tab instead of as a new window:

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal new-tab true