Set default terminal in gnome

Hello. I am using GNOME 3 on Fedora.
There’s a way for changing the default terminal in other desktops and ubuntu, but there’s no way for gnome on fedora.
This code didn’t worked:

gsettings set org.gnome.desktop.default-applications.terminal exec kitty
2 Likes
chsh

(change shell) should do the job.

Example
chsh -s $(which fish)

Too bad I am not answering your question. I just realized you want to change the terminal emulator, not the shell…
To be honest, I don’t understand what it means to change the default terminal, in Gnome the user starts up the terminal, so you decide which one you fire up.

Maybe this helps: [Solved] Can't set default terminal emulator to urxvt on Budgie/Gnome3 / Applications & Desktop Environments / Arch Linux Forums

4 Likes

Thank you. It was helpful. I should ask Gnome developers.
Default Terminal used when you click ‘Open in Terminal’ in right click menu of a folder or an executable, also it opens when you run a .desktop file with ‘Term=yes’

2 Likes

Using the Dconf editor(needs to be installed), go to /org/gnome/desktop/applications/terminal/exec, set it to use a custom value and set the custom value of your default terminal emulator as a command eg: ‘alacritty’ or ‘tilix’ or ‘kitty’.

Edit: This key seems to be deprecated and ignored in gnome 40 in favor of the one set by GAppInfo. Maybe that’s why gsettings command doesn’t work either.

1 Like

Revisiting this, has anyone any idea how to configure applications required by gio? If I have a mimetype associated with a desktop app whose *.desktop entry has Terminal=true, xdg-open (or gio open) is met with gio: Unable to launch application [whatever]’: Unable to find terminal required for application. The mimetype is correctly set - gio finds the correct desktop file - but then it can’t find a terminal to run the app in.

You can symlink one of those terminals used by gio to your terminal emulator. I have used nxterm and placed symlink in /usr/local/bin but it can be any directory in your PATH environment variable.

sudo ln -s $(command -v foot) /usr/local/bin/nxterm
2 Likes

The problem is I don’t know what terminal gio wants to use (or if it’s configured to use one at all).

In this case I’m trying to get mailto to work. All xdg-open mailto:test@test.com or gio open mailto:test@test.com result in is gio: mailto:test@test.com: Unable to find terminal required for application.

I do have the mailto mime type set up. The output for gio mime x-scheme-handler/mailto is:

Default application for “x-scheme-handler/mailto”: neomutt.desktop
Registered applications:
	neomutt.desktop
	Mailspring.desktop
	mozilla-thunderbird-wayland.desktop
	mozilla-thunderbird.desktop
	org.gnome.Geary.desktop
Recommended applications:
	neomutt.desktop
	Mailspring.desktop
	mozilla-thunderbird-wayland.desktop
	mozilla-thunderbird.desktop
	org.gnome.Geary.desktop

which is correct (I have neomutt.desktop in my .local/share/applications)

1 Like

Ah found it! gio uses a hardcoded list of terminal apps (crazy but true)*. Hence gio reporting that it couldn’t find a terminal app.

So following your notion I symlinked the terminal I use (kitty) to /usr/local/bin/gnome-terminal. Thanks for nudging me in the right direction.

[*] for anyone interested, here’s the list: gio/gdesktopappinfo.c · main · GNOME / GLib · GitLab. The check is really rough - in particular note that it runs through the list in order, so (a) won’t necessarily find your preferred terminal, and (b) if you do the symlink workaround, gnome-terminal is the safest (as it’s checked first)

3 Likes