Unable to change default terminal on manjaro-i3


I was on XFCE and switched to i3.
Everything is fine but I can’t seem to change the default terminal.

I changed the i3 .config file to open all applications in lxterminal.
I am using the default i3 config file from gitlab i.e i3-wm-config/i3-manjaro-default-config-backup at master · sainathadapa/i3-wm-config · GitHub

As I mentioned, I replaced every “terminal” with lxterminal and now I need to set $TERM or $TERMINAL to lxterminal which will allow me to open files directly in lxterminal. For example: Say I am in PCmanFm and press enter in .a text file, so naturally the file will be opened using default editor(which here is neovim) and inside the default terminal(which always seems to be xterm-256 for some reason). I set export TERMINAL= /usr… in .profile and that didnot work. Same goes for /usr/bin/terminal where I set lxterminal @a.

Thank you for going through this!

How this was done in the Manjaro i3 edition is a creative solution, but a bit strange - IMO.

If you want to change the default terminal (which is urxvt)

setting it in ~/.profile doesn’t work
Because “they” actually created a script in /usr/bin
where this is set to start urxvt
(hardcoded, in a way)

What does work is to override this
by creating a similar file in ~/.local/bin
make it executable
and have it start your desired terminal
for example xterm
by writing this into that file:

xterm $@

1 Like

Thank you for replying but even after following all your steps(I even made the script executable) it does not work. And while I echo $TERM , it is still xterm-256-color.
And after uninstalling xterm, I get this message when pressing enter on the file I want to open(I want to open it with Neovim)

Edit: I uninstalled xterm in hopes of lxterminal being the default terminal by priority order.

Perhaps this (some left over configuration files) is foiling your efforts.
I don’t know.
I tested with a fresh install of the Manjaro i3 edition.

And I know for a fact that it works there. :man_shrugging:

cat /usr/bin/terminal

gives you the content of the original file

you override that with creating one of the same name in ~/.local/bin

cat ~/.local/bin/terminal

should give you what you wrote into it

xterm $@
alacritty $@

or whatever terminal app you like to use instead of urxvt - because that is the default

Of course, this override will only work if your $PATH is set so that
/home/username/.local/bin will be searched before /usr/bin
but this should be the default

echo $PATH

I have changed nothing else.
Just installed alacritty so that I could test with another terminal than xterm, which was already installed by default.

That is not optional - the script needs to be executable.
It’s not actually a script - you could make it more proper by starting with shebang like:

alacritty $@

(screenshot with error because xterm isn’t there anymore)

are you really surprised about that?

Thank you for having the patience to deal with this.
Apparently, it was the problem in pcmanfm. When the .local/bin/terminal was changed to lxterminal $@ , pcmanfm had its default terminal still set to xterm, hence I could not open nvim. I changed the default terminal to lxterminal and now it works just fine. Your initial answer was correct.
Thank you! :smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.