Making preferred terminal default for Advanced MATE Menu

:manjaro: This guide assumes you use the community-maintained Manjaro MATE 20.0.1. Your milage may vary with anything which isn't this, and may require additional configuration of your sources.

:arch: The software exhibited in this guide can be installed from the AUR as mate-menu

:manjaro: Introduction

For people who are coming from Linux Mint, Ubuntu MATE, Windows Vista or Windows 7 who want something vaguely Redmond-ish, such users might be interested in a utility which began life within the development team of Linux Mint known as MATE Menu (or, within Linux Mint, Mint Menu).

For sake of familiarity, this solution is good enough for most people. But there is a problem with it — its default for terminal is the emulator which comes with MATE. This is great if you use mate-terminal daily and have no problem with it, but some users might prefer another terminal which is either lighter to run or possesses more features.

A preference for terminal can be selected within mate-default-application-properties and xdg-utils will always respect that as xdg-terminal :arch: but in spite of that, mate-menu never will without some tweaking under the hood. So let's do that.

:arch: Enabling xdg-terminal requires installation of xdg-utils-terminal-true-git from AUR which will supersede (and thus remove) xdg-utils. This is safe to perform and reversible should you not want the functionality of preferred terminal as xdg-terminal.

:wrench: Modifying MATE Menu

:books: This knowledge comes from my prior history of MATE elsewhere on the Ubuntu MATE forums for making x-terminal-emulator the default terminal to select. This method is absolutely atrocious compared to the more elegant XDG solution, but some people might prefer that if they are on Debian. This guide will be linked at the bottom later.

To fix this issue, MATE Menu's system_management.py :link: must be modified. In Manjaro / Arch, this is located in /usr/lib/python3.8/site-packages/mate_menu/plugins. In a terminal emulator :fast_forward:, as follows:

:fast_forward: For brevity, terminal will always be referred to as xdg-terminal regardless which instance of xdg-utils is present in your system. Replace with preference if desired. Also, pluma will be assumed editor here. Use whatever you want or have installed if not that.

:heavy_dollar_sign: In xdg-terminal:

cd /usr/lib/python3.8/site-packages/mate_menu/plugins
sudo pluma system_management.py

:link: If you want to make a backup, sudo cp system_management.py prior, sudo mv them both to rename and sudo ln -s whichever instance you will use as system_management.py. This way, if the modification fails due to user error and you need to continue work right now you can sudo rm -rf the link and remake it to the original copy you had not modified.

With that opened, now do this:

:spiral_notepad: In pluma, for /usr/lib/python3.8/site-packages/mate_menu/plugins/system_management.py, lines 180-185:
Replace:

           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" )

With:

           if pathExists("xdg-terminal"):
               Button4.connect( "clicked", self.ButtonClicked, "xdg-terminal" )
           elif pathExists("x-terminal-emulator"):
               Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" )
           elif pathExists("mate-terminal"):
               Button4.connect( "clicked", self.ButtonClicked, "mate-terminal" )

:left_right_arrow: This is also cross-compatible with mate-menu instances in Debian systems lacking XDG.

:x: If you happen to revert xdg-utils later, mate-terminal will become fallback.

Don't forget the spaces! Once those changes are performed, place Advanced MATE Menu item in a panel of choice, or if it already exists, to update all existing panel items by reloading them:

:heavy_dollar_sign: In xdg-terminal:

mate-panel --replace

Then try; Open the menu and select Terminal. xdg-terminal (being your preference defined in MATE's Preferred Applications dialog) should open up, which will match caja's behaviour and whatever your keybind for opening a terminal is.

:information_source: Sources

1 Like

Forum kindly sponsored by