Haven't you written about this before?
Yes, I've had written about this particular topic before. But since "Default terminal" isn't something that appears in a search here, and it wasn't all in one place to my knowledge. I figured a new guide was justified. That, and I am really, really lazy.
If you're just getting into Linux, or had been for awhile and wanted to use something other than
mate-terminal then there is no limit for the options available to you. But no matter your preference, you'll had noticed there's no easy way to change it all at once. You can change the default terminal Caja uses, but those changes don't apply to anything which could prompt
x-terminal-emulator which is why MATE Menu doesn't respect your specification there, and you also cannot normally select
x-terminal-emulator as a preferred application to make your life easier.
The intention of this guide is to make your future life easier by doing something in the present. When finished, you should be able to change the default terminal everywhere with one single action.
Fixing the file manager
Unfortunately, the default terminal according to
update-alternatives isn't respected as a selection for Preferred Applications. That shouldn't stop you from making it a reality, however and with a little extra effort you'll be able to easily select it there. To begin, start in your terminal;
pluma, replace with your preferred text editor.
sudo pluma /usr/share/applications/x-terminal-emulator.desktop
Then, put this in it:
Most of this was taken from
mate-terminal.desktop. You can also probably pare it down further, I didn't tamper with too much of the defaults to ensure success.
In your preferred text editor, for
[Desktop Entry] Name=x-terminal-emulator GenericName=Terminal TryExec=x-terminal-emulator Exec=x-terminal-emulator Icon=utilities-terminal Type=Application Categories=System;GTK;Utility;TerminalEmulator; StartupNotify=true Keywords=GNU;terminal;shell;prompt;command;commandline;
Save it, then when you next look in Preferred Applications,
x-terminal-emulator will show up there. Once defined, it should open whatever
x-terminal-emulator is configured for. For most people, this will usually be to open a terminal from the file manager.
Fixing MATE Menu
If you are a user of the Advanced MATE Menu, you'll notice the terminal doesn't open to whatever you defined as default. While unfortunate, it is just as easy as ever to resolve. But first, back up;
You can also simply open this file in your preferred text editor and save as something else, but this is intended to be the faster method for people in a rush to complete this task.
cd /usr/lib/python3/dist-packages/mate_menu/plugins sudo cp ./system_management.py system_management_old.py
Older versions of this software use an older version of Python. If not
python2.7instead. I am probably missing information for older revisions beyond that.
Optionally while you're there, you could rename the current iteration, then link it:
sudo mv system_management.py system_management_new.py sudo ln -s $PWD/system_management_new.py ./system_management.py
Afterward, do the following:
sudo pluma ./system_management.py
In your preferred text editor, for
system_management.py@ lines 180-185:
if pathExists("mate-terminal"): Button4.connect( "clicked", self.ButtonClicked, "mate-terminal" ) elif pathExists("xdg-terminal"): Button4.connect( "clicked", self.ButtonClicked, "xdg-terminal" ) elif pathExists("x-terminal-emulator"): Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" )
if pathExists("x-terminal-emulator"): Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" ) elif pathExists("xdg-terminal"): Button4.connect( "clicked", self.ButtonClicked, "xdg-terminal" ) elif pathExists("mate-terminal"): Button4.connect( "clicked", self.ButtonClicked, "mate-terminal" )
You must copy the spaces, too! To do this without copying the above, move lines 184 and 185 above line 181, then move what is now at lines 182 and 183 above line 185. Then swap
elifin lines 180 and 184.
Did you make that link earlier? If you goofed and you need the MATE Menu to work again in quick order, then you can do this:
sudo rm -rf ./system_management.py sudo ln -s $PWD/system_management_old.py system_management.py
When finished, save your changes. You will also need to restart mate-panel for changes to apply:
This should relaunch
mate-panelin accordance with dconf schema
/org/mate/desktop/session/required_components panelbut if however it doesn't reload, then in your current terminal instance launch
mate-panel &and you'll get it back.
Then proceed to the whole point of this ordeal;
All that's left to do is to adjust
update-alternatives so it uses your preference:
sudo update-alternatives --config x-terminal-emulator
You will be presented with a menu, which will allow you to select the default terminal. Based on the changes you performed above, this will also change the default terminal for MATE Menu and Caja's "Open in Terminal" action, as nature intended.
Whoopsie, I edited the wrong file! No harm, no foul anyway. So MATE Menu section is fixed, and the correct spacing is in each monospaced line.