Changing the default terminal that i3 uses

I have i3 setup as my window manager and I edited my config and changed the following line in config to get alacritty to launch as my default terminal.

bindsym $mod+Return exec alacritty

But whenI reload i3 and I get a config error and click on the button to edit the config, it loads xcfe-terminal with vim running in it.

How do I make Alacritty the default terminal system-wide?

It might help to edit file
/etc/eos-script-lib-yad.conf
value of variable
EOS_YAD_TERMINAL.

1 Like

Could it be that under `assign [class=ā€œxfce4-terminalā€] $ws1ā€™

You have not yet changed it to alacritty? You can also comment it with # if you prefer no assigning terminal to workspace 1.

Same for the for_window command. I would just search the config for xfce4-terminal and replace with your preferred terminal.

1 Like

I created a .profile in my home directory and added the line:

export TERMINAL=alacritty

I then edited .config/i3/config

and added the following line:

bindsym $mod+Return exec i3-sensible-terminal

But most of thre EndeavorOS stuff still pops XFCE-Terminal.

Now, when I right click on a file on thunar and try to open it in vim, vim opens in xfce4-terminal. That may be an xfce4 issue, and an EndeavorOS specific issue.

That might be some configuration the i3wm Endeavour maintainer did. I installed thunar again and tried it myself, and it also does open in xfce4-terminal, even though my default terminal emulator is set to st.

When I try it in pcmanfm, the gui file manager I use, it just works and opens neovim inside st.

Maybe Joe Kamprad could help you on that?

If you need to get it to work quickly, I would advise you to use another file manager, either through a GUI or a CLI (pcmanfm and ranger/vifm/lf are some choices).

thunar is an xfce4 application :wink: we do not set this up to open in xfce4 terminal. but you can change that in thunar afaikā€¦

uses exo-open in thunar:
2021-12-08_11-11
2021-12-08_11-11_1

and on eos apps it is set to choose the first one it finds to be usedā€¦ so you can try uninstalling xfce4-terminal or set one in configs:
edit: /etc/eos-script-lib-yad.conf
and change + uncomment this line:
# EOS_YAD_TERMINAL="terminator"

1 Like

Hi, I have the exact same issue, so Iā€™m necrobumping this because given solutions donā€™t work.

The ā€˜Open terminal hereā€™ right-click menu works, however, but opening files (with terminal vim) from thunar doesnā€™t. Iā€™ve uninstalled xfce4-terminal, but that results in a popup ā€œUnable to find terminal required for applicationā€ when trying to open a file in terminal vim.

I have edited /etc/eos-script-lib-yad.conf and set EOS_YAD_TERMINAL="alacritty" and as instructed in said file, checked that alacritty is indeed supported.

Also tried reinstalling thunar, vim, and alacritty. Iā€™ve also installed xfce4-settings, and by running xfce4-settings-manager I can go and set my Default Applications, but even this doesnā€™t help. Only fishy thing I noticed while setting Terminal Emulator in Default Applications is, that when I choose alacritty, the app thumbnail isnā€™t loaded, while with other apps it is.
I noticed that /usr/share/applications/Alacritty.desktop is capitalized, but playing around with that doesnā€™t help. exo-open --launch TerminalEmulator launches alacritty as it should. I also tried editing /etc/xdg/xfce4/helpers.rc

Even pcmanfm doesnā€™t work: ā€˜open with vimā€™ doesnā€™t do anything and clicking on a text file tries to open xterm.

For now the only way is to use terminal or terminal based file manager and open file explicitly in vim. Running out of ideasā€¦

same as before this is not an issue with i3 and more with thunar or vim itselfā€¦

https://man.archlinux.org/man/i3-sensible-terminal.1.en

so it will need to set the terminal as an environment variable somewhere in your configs ā€¦ in ~/.profile ~/.config/environment.d/*.conf

something like this?

~/.config/environment.d/envvars.conf

export $TERMINAL=alacritty

Thanks! And sorry for bringing in issues that may not be i3 specific. I recently used EOS bspwm edition, and using xfce4-settings-manager was enough then to fix the issue, so that lead me to suspect i3.

Iā€™ve now fixed the issue, but given advice didnā€™t work. I had set the environment variable and the issue still persisted with other file managers, so there definitely is something else going on than just thunar. Maybe I have just misconfigured something, but Iā€™ve pretty much reset everything I could think of.

While searching around for my error message ā€œUnable to find terminal required for applicationā€ I found this comment in unrelated project, where is said

This [error message] is because gnome has a hardcoded list of terminals that it looks for. Issue filed here https://gitlab.gnome.org/GNOME/glib/-/issues/2293

Here is the list of hardcoded terminals https://gitlab.gnome.org/GNOME/glib/-/blob/c1a11c02e5ef458f328c1ed938d6077a4fd7deb3/gio/gdesktopappinfo.c#L2548-2586

(The list contains gnome-terminal mate-terminal xfce4-terminal nxterm color-xterm rxvt dtterm xterm)

Real upstream issue is at https://gitlab.gnome.org/GNOME/glib/-/issues/338 butwhile there is activity, it is 11 years old and still open. So I would jot hold my breath.

So now it started to look like gnome / glib issue.

Two little bit ugly fixes I found were

  1. ln -s /usr/bin/alacritty /usr/bin/xterm.

and other from this reddit thread (this I prefer, because itā€™s user specific)

  1. copy /usr/share/applications/vim.desktop to ~/.local/share/applications/vim.desktop and change the Exec-line to Exec=alacritty -e vim %F and set Terminal=false.

I had tried the latter before, but without Terminal=false because that didnā€™t seem to make any sense. But I now realize that the desktop file effectively launches a terminal emulator, which itself is not opened in any terminal, so I guess thatā€™s whyā€¦

I still donā€™t know why all this trouble was needed this time and not before. But now everything works and Iā€™m happy! :slight_smile: I hope this helps if someone else has the same issues.

2 Likes