Score:4

Make alacritty the default terminal permanently

ph flag

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?

Score:0
in flag

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:

sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/alacritty 50

(The number ‘50’ at the end represents the priority of the entry)

It will then be possible to define it as the default terminal, thanks to the command:

sudo update-alternatives --config x-terminal-emulator

Finally, if you want to remove alacritty from the available alternatives:

sudo update-alternatives --remove "x-terminal-emulator" "/usr/bin/alacritty"

If the above commands shows error I believe you can open dconf Editor on default ubuntu desktop (gnome)

dconf-editor

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

gsettings set org.gnome.desktop.default-applications.terminal exec cmd_to_open_terminal_of_choice

Just be carefull and be sure you can restore the default.

Hope it will helps you

Score:0
in flag

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.

Luís de Sousa avatar
ph flag
You might have missed this segment in the question: "every time I run the updates the priorities in this list are automatically modified and alacritty stops being the default programme".
emk2203 avatar
in flag
I didn't miss it, but for me it was just describing the process which happens at auto mode. Something like "every time I run the updates, the priorities are set back to auto mode from manual mode and alacritty stops..." would have been clearer.
Score:-1
jp flag

Judging by the answer here https://stackoverflow.com/a/18647630 the following would work

gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/alacritty

This will work in gnome but your mileage may vary if you have a different DE.

Testing

nathans@skynet:~$ sudo gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/terminator
[sudo] password for nathans: 
nathans@skynet:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  chromium-codecs-ffmpeg-extra gstreamer1.0-vaapi i965-va-driver intel-media-va-driver libaacs0 libaom0 libass9 libavcodec58 libavformat58 libavutil56 libbdplus0 libblas3 libbluray2
  libbs2b0 libchromaprint1 libcodec2-0.9 libdav1d4 libfftw3-double3 libflite1 libgme0 libgsm1 libgstreamer-plugins-bad1.0-0 libigdgmm11 liblilv-0-0 libllvm11 libmfx1 libmysofa1
  libnorm1 libopenmpt0 libpgm-5.3-0 libpostproc55 librabbitmq4 librubberband2 libserd-0-0 libshine3 libsnappy1v5 libsord-0-0 libsratom-0-0 libsrt1.4-gnutls libssh-gcrypt-4
  libswresample3 libswscale5 libudfread0 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvidstab1.1 libx265-192 libxvidcore4 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers
  ocl-icd-libopencl1 pocketsphinx-en-us va-driver-all
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  tzdata
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 standard security update
Need to get 296 kB of archives.
After this operation, 2,048 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 tzdata all 2021a-2ubuntu0.21.04 [296 kB]
Fetched 296 kB in 0s (1,730 kB/s)
Preconfiguring packages ...
(Reading database ... 178432 files and directories currently installed.)
Preparing to unpack .../tzdata_2021a-2ubuntu0.21.04_all.deb ...
Unpacking tzdata (2021a-2ubuntu0.21.04) over (2021a-1ubuntu1) ...
Setting up tzdata (2021a-2ubuntu0.21.04) ...

Current default time zone: 'Europe/London'
Local time is now:      Wed Oct  6 15:36:18 BST 2021.
Universal Time is now:  Wed Oct  6 14:36:18 UTC 2021.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

nathans@skynet:~$ sudo update-alternatives --config x-terminal-emulator 
There are 2 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).

  Selection    Path                             Priority   Status
---------------------------------------------
  0            /usr/bin/terminator               50        auto mode
  1            /usr/bin/gnome-terminal.wrapper   40        manual mode
* 2            /usr/bin/terminator               50        manual mode

Updated answer to show the command functioning and running a system upgrade on ubuntu 21.04.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.