GNOME Files open current directory in custom terminal

I’m trying to get GNOME Files to open my preffered terminal application. Since the default GNOME terminal, kgx/“Console”, is hardcoded into nautilus, some working around is needed. I’m documenting my attempts here, maybe it will help someone to not waste so much time with this problem.

  • :cross_mark: Attempt 1: add a script in ~/.local/share/nautilus/scripts/open-alacritty.sh (made executable with chmod a+x open-alacritty.sh) → No additional context menu entry appears.
  • :cross_mark: Attempt 2: Nautilus calls org.gnome.Console by default to open a terminal. Override its behavior by adding a custom ~/.local/share/applications/org.gnome.Console.desktop which calls alacritty? → “Open in Console” still opens the gnome console. Desktop file contents:
    [Desktop Entry]
    Name=Console
    Exec=alacritty
    
  • :white_check_mark: Attempt 3: add nautilus-open-any-terminal extension to NixOS: I followed the instructions for NixOS by adding programs.nautilus.open-any-terminal = {enable = true; terminal = "alacritty";};:partying_face: After reboot, a new context menu entry appears! However, I cannot set a keybinding because the schema does not exist in dconf-editor, and the default keybinding <Ctrl><Alt>t does nothing.
    • The relevant schema is located in $out/share/gsettings-schemas/python3.13-nautilus-open-any-terminal-0.8.1/glib-2.0/schemas.
    • Calling XDG_DATA_DIRS=/nix/store/fw25cpvjkkx897r7d9bb9719pfyad4rg-python3.13-nautilus-open-any-terminal-0.8.1/share/gsettings-schemas/python3.13-nautilus-open-any-terminal-0.8.1:$XDG_DATA_DIRS dconf-editor loads the schema & allows me to make edits.
    • :cross_mark: Nautilus doesn’t react to the custom keybinding or default keybinding (even when called with the updated $XDG_DATA_DIRS).
Context
  • I’m on nixos-unstable commit c6245e83d836d0433170a16eb185cefe0572f8b8
  • I always run nautilus -q to make sure nautilus is shut down before running tests
  • services.displayManager.gnome.enable is set to true, nautilus is installed system-wide
  • When I say “No additional context menu entry appears”, I’m referring to the Nautilus context menu, which should have a “Scripts” submenu (using nautilus scripts) or “Open Alacritty Here” (with nautilus-open-any-terminal extension):

See also: