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.
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
Why?
Because “they” actually created a script in /usr/bin /usr/bin/terminal
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 ~/.local/bin/terminal
make it executable
and have it start your desired terminal
for example xterm
by writing this into that file:
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.
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 $@
or 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:
#!/bin/sh
alacritty $@
(screenshot with error because xterm isn’t there anymore)
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!