Currently I use alacritty
as default terminal emulator. On any given day this is the output of update-alternatives
:
$ sudo update-alternatives --config x-terminal-emulator
There are 7 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/alacritty 70 auto mode
1 /usr/bin/alacritty 70 manual mode
2 /usr/bin/gnome-terminal.wrapper 40 manual mode
3 /usr/bin/koi8rxterm 20 manual mode
4 /usr/bin/lxterm 30 manual mode
5 /usr/bin/uxterm 20 manual mode
6 /usr/bin/xterm 20 manual mode
7 /usr/local/bin/termite 60 manual mode
Press <enter> to keep the current choice[*], or type selection number:
However, every time I run the updates the priorities in this list are automatically modified and alacritty
stops being the default programme (and is removed from auto mode
):
$ sudo update-alternatives --config x-terminal-emulator
There are 7 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/local/bin/termite 60 auto mode
1 /usr/bin/alacritty 50 manual mode
2 /usr/bin/gnome-terminal.wrapper 40 manual mode
3 /usr/bin/koi8rxterm 20 manual mode
4 /usr/bin/lxterm 30 manual mode
5 /usr/bin/uxterm 20 manual mode
6 /usr/bin/xterm 20 manual mode
7 /usr/local/bin/termite 60 manual mode
Press <enter> to keep the current choice[*], or type selection number:
It is possible to reset alacritty
as the default terminal emulator with a
command like:
$ sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/alacritty 70
Until the updates are run and it all gets back to square one. How can I prevent
the alternatives priorities from being modified automatically, setting alacritty
permanently as the
default terminal emulator?
How to choose Alacritty as default terminal emulator.
To launch Alacritty with the command to open its default terminal, it is necessary to define it as an alternative available for ‘terminal’ type applications:
(The number ‘50’ at the end represents the priority of the entry)
Or try with
/usr/local/bin/alacritty
instead.It will then be possible to define it as the default terminal, thanks to the command:
Finally, if you want to remove alacritty from the available alternatives:
Or try again with
/usr/local/bin/alacritty
instead.If the above commands shows error I believe you can open
dconf
Editor on default ubuntu desktop (gnome)(it will prompt to get installed at first)
and go to org > gnome > desktop > application > terminal and change gnome-terminal to the terminal of your choice.
You can do the same from command line with
With
cmd_to_open_terminal_of_choice
as 'alacritty' here, that is, without its path.Just be careful and be sure you can restore the default which is also given in the dconf-editor menu if you forgot about it after a while.
When you now press Ctrl+Alt+T, 'alacritty' will open instead of 'gnome-terminal'.
Hope it will helps you
As your first picture indicates by showing the starred zero and the "auto mode", the link group "x-terminal-emulator" is in auto mode.
What you want is to have it set to manual mode. This way, the alternative sticks regardless of the priority. You can achieve this by selecting "1" after your command of
$ sudo update-alternatives --config x-terminal-emulator
.This way, the chosen
alacritty
should stay.Judging by the answer here https://stackoverflow.com/a/18647630 the following would work
This will work in gnome but your mileage may vary if you have a different DE.
Testing
Updated answer to show the command functioning and running a system upgrade on ubuntu 21.04.