Alacritty as default GNOME terminal application

Personally I prefer Super+T as my primary shortcut for opening the terminal from anywhere in my desktop environment. However, how can I replace the existing terminal application in GNOME so that the keyboard shortcut setting applies to an alternative terminal emulator?

Well, turns out that gsettings is the answer once again. The default is this on (vanilla) GNOME:

org.gnome.desktop.default-applications.terminal exec-arg '-e'
org.gnome.desktop.default-applications.terminal exec 'x-terminal-emulator'

If you use other GNOME-based desktop environments (gsettings normally only applies to those), the prefix (org.gnome) may be different and it’s best first to figure out the setting that applies to your system by inspecting the output of gsettings list-recursively.

As an example, on Cinnamon you’d use org.cinnamon.desktop instead of org.gnome.desktop for those keys.

In my case I was setting it as follows:

gsettings set org.gnome.desktop.default-applications.terminal exec alacritty
gsettings set org.gnome.desktop.default-applications.terminal exec-arg ''

These settings only apply to the current user running these commands.

If you wanted to change the default terminal emulator at a system-global level and your alternative was a packaged application, known by update-alternatives to belong to the group x-terminal-emulator, you could use this (as superuser, e.g. with sudo):

update-alternatives --config x-terminal-emulator

Last but not least you could manipulate the PATH variable in a way that places your favorite terminal emulator first and under the name x-terminal-emulator. This solution is still somewhat hacky as it assumes that whatever arguments get normally passed to the default terminal emulator are understood by your favorite one. But it’s generally viable.

This entry was posted in EN, Linux, Software, Unix and unixoid and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *