[HowTo] Enabling KDE global menu support in Mozilla Firefox and Thunderbird

Difficulty: ★☆☆☆☆

Those of you who like the global menu in KDE Plasma will have already noticed that neither Firefox nor Thunderbird export their application menu to the Plasma global menu widget out-of-the-box. And indeed, in their original form as they ship from Mozilla, these two popular applications do not. But that doesn’t mean that you’re stuck with an inconsistent look & feel on your desktop.

The thing however is that you must not be using the stock Firefox and/or Thunderbird anymore, but that you must instead use one of the specially patched versions of these two software titles. This HowTo is intended to present you with the alternatives that do play nice with KDE Plasma. :slight_smile:

Global menu support in other GTK-based applications

In order to have global menu support in other GTK-based applications, you must have the appmenu-gtk-module package installed ─ it’s in the Manjaro repository.

In some cases, this package may however cause Firefox (and derivatives) and Chrome/Chromium to segfault. In that case, it is recommended to replace the appmenu-gtk-module package from the Manjaro repository by the appmenu-gtk-module-git package from the AUR. This is a source code package that must be compiled locally by way of an AUR helper application ─ see farther down ─ or by Pamac, but doing so doesn’t take very long; it’s a lightweight package. :wink:

Note: There is to the best of my knowledge no global menu support for the Pale Moon browser, which is a Firefox fork specifically developed with the user interface of the Firefox 2.x generation. :man_shrugging:


Firefox versions with global menu support

Firefox is the Mozilla application where you have the most options, because there are three versions with global menu support in the AUR (“Arch User Repository”) that you can choose from, as well as a standalone version ─ the one we’ll address here first ─ which was specifically developed for Manjaro.

1. Plasmafox

Plasmafox was specifically developed ─ and is still being maintained ─ for Manjaro by a former forum member, Torvic9. It is based upon firefox-kde-opensuse from the AUR, with special privacy enhancements from Waterfox, which itself is another Firefox fork.

You can download a readily installable Manjaro package of Plasmafox here. Be sure to then also download the Plasmafox Helper package for further Plasma integration.

And this is then what it looks like… :arrow_down:

Notes:

  • The theme may differ depending on your own preferences. You can add themes to Plasmafox just as you would to the regular Firefox.

  • Plasmafox does not adopt or inherit the settings, preferences or bookmarks of any existing Firefox installation. It uses its own configuration files.

  • Update - 2020.08.27: I have just been informed that the developer of Plasmafox has decided to focus on EndeavourOS and that he as such won’t guarantee the proper operation of Plasmafox in Manjaro anymore. :arrow_down_small:

He does however believe that it’ll most likely still work in the Manjaro Unstable branch. :man_shrugging:

2. firefox-kde-opensuse

This is the patched Firefox that Plasmafox is partly based upon. The package can be downloaded from the AUR, in two versions:

  • firefox-kde-opensuse
  • firefox-kde-opensuse-bin

Unless you’ve got loads of RAM to spare and you have a very fast computer, you will almost with certainty want to choose the latter package, because ─ like with most software from the AUR ─ the first package comes as source code only and must be compiled on your own computer.

When I was still new to Manjaro, I once made the mistake of picking the source code version ─ there may not even have been a pre-compiled binary version of it at the time ─ and it took my computer a whole five (5!) hours to compile and link the source code and turn it into an installable package, with all RAM maxed out, 80% of my swap partition filled up, and all 6 cores of my i5-8400 processor running at the full 100% load. And all the while, the system was completely unusable for anything else.

So, again, unless you’ve got a very powerful machine with loads of RAM ─ say at least 32 GiB ─ you will most likely want to go with the pre-compiled version, i.e. firefox-kde-opensuse-bin.

3. firefox-appmenu

Same comments as here-above. It’s a package from the AUR, and it comes as both a source-code-only variant and as a pre-compiled variant.

  • firefox-appmenu
  • firefox-appmenu-bin

This is what it looks like… :arrow_down:

4. firefox-ubuntu-bin

This version has global menu support patches from Ubuntu, given that Ubuntu uses GNOME as the default desktop environment, and Unity before that, and both GNOME and Unity have/had a global menu.

This version of Firefox is once again available from the AUR, but it comes as a readily installable binary package only. As the name says, the package is called firefox-ubuntu-bin.


Thunderbird versions with global menu support

Analogous to Firefox ─ with the exception of Plasmafox ─ these are packages from the AUR. The offer is however a bit more limited than for its browser sibling.

  • thunderbird-appmenu ─ source code only
  • thunderbird-appmenu-bin ─ pre-compiled and readily installable binary package
  • thunderbird-ubuntu-bin ─ pre-compiled and readily installable binary package

How do I install any of these packages?

1. Using the GUI

  1. If you use the GUI version of Pamac, then you can simply install them from there.

  2. If you use Octopi, then you must enable support for the AUR in the settings, and then you must also install an AUR helper program such as yay or trizen from the standard Manjaro repository. Then, you can click on the :alien: icon next to the search field, and then you type the name of the package in the search field and you press Enter/Return. You can then mark the package for installation, and the AUR helper will do the rest. :wink:

2. By way of the command line

This suggests that you use the command-line version of pamac, or that you have an AUR helper installed.

Given that I don’t have pamac installed here, but instead I have the AUR helpers yay and trizen, here’s how I do it. As an example, we’re going to be using the package firefox-kde-opensuse-bin

yay -Syyua firefox-kde-opensuse-bin

This command will first make sure that your entire system is fully up-to-date, including any AUR packages you already have installed and of which a newer version has been uploaded to the Arch User Repository in the meantime.

It is not necessary to prefix this command with sudo; in fact, yay will refuse to work if you do that, and instead it will prompt you for the root password when necessary. After making sure your system is fully up-to-date, yay will then download and install the package. No need to log out or reboot, because it’ll be readily available from the system menu right away.

If instead you prefer the use of pamac, then ─ using the same firefox-kde-opensuse-bin package as an example ─ the command would be this… :arrow_down:

pamac build firefox-kde-opensuse-bin 

Further Plasma integration

While all of the above so far has been pertinent to getting global menu support in Firefox and Thunderbird, there is however something more you can do to have these applications further integrate with KDE Plasma.

  1. Install the kmozillahelper package from the repository.
    (Note: For Plasmafox you instead need to install the kplasmafoxhelper package ─ see the links higher up in this post.)

  2. Install the xdg-desktop-portal-kde package from the repository (if it’s not installed already).

  3. Install the plasma-browser-integration package from the repository (if it’s not installed already).

  4. The following is not needed for Plasmafox, but for any of the other Firefox variants discussed in this post and for Thunderbird, you need to edit the file /etc/profile.d/mozilla-common.sh and add the following line to it… :arrow_down:

export GTK_USE_PORTAL=1

You will need to log out of Plasma and log back in for this last setting to take effect, because the contents of the files under /etc/profile.d/ are only ever read at login time. :wink:


Hopefully this information was useful. Enjoy! :slight_smile:

:beer:


This HowTo is a wiki. Anyone can amend the information in this post.

6 Likes

I did install appmenu-gtk-module however gtk apps still do not have the global menu.

Plasma 5.19.4 has introduced a bug in the Plasma global menu widget itself, which will not show the global menu for GTK applications unless you switch to a KDE/Qt application first and then back to the GTK application.

The bug has been reported to the KDE developers upstream, so they know about it. :wink:

1 Like

Hmm weird even switching back does not work…

It does for me ─ even if the KDE application and the GTK application are on different virtual desktops.

What GTK application are you testing this with?

Just Pamac

Pamac does not have a menu that it can export ─ and for that matter, likewise for TimeShift. Instead it only has a toolbar and a “hamburger menu”. :wink:

I do remember the “hamburger menu” of GEdit being exported in another distro. And fairly clearly. Probably in Kubuntu.

Some applications can do that ─ Chromium is one of them, and it doesn’t even need appmenu-gtk-module for that ─ but not all of them do. Pamac does not, and neither does TimeShift.

This here-below is Claws Mail, a GTK-based email and Usenet client ─ I am using it for Usenet only ─ and clearly it works, albeit ─ as I said already ─ that in Plasma 5.19.4, you have to activate a KDE/Qt-based application first before the GTK application’s menu is visible in the Plasma global menu widget. :arrow_down:

And this here is GIMP. :arrow_down:

2 Likes

If you still can’t get global menus in Firefox/Thunderbird, Libre Office and GTK apps, this mean you lack of some packages.
Here is the list of packages to install to get global menus (will add to the first message when I get back editing features with some further trust levels on the forum):

appmenu-gtk-module
appmenu-qt4 - optional, for qt-4 apps if you still have some
lib32-libdbusmenu-glib
lib32-libdbusmenu-gtk2
lib32-libdbusmenu-gtk3
lib32-libdbusmenu-qt
libdbusmenu-glib
libdbusmenu-gtk2
libdbusmenu-gtk3
libdbusmenu-qt4 - optional, for qt-4 apps if you still have some
libdbusmenu-qt5

2 Likes
lib32-libdbusmenu-glib
lib32-libdbusmenu-gtk2
libdbusmenu-glib
libdbusmenu-gtk2
libdbusmenu-gtk3
libdbusmenu-qt5

These all came installed by default in my system. :wink:

They should, but I saw many people that didn’t have all needed packages. Old installs, or maybe certain packages were uninstalled when they fiddled with the system. Anyway, the list is a nice way to check if you have all what is needed for global menus in Plasma.

2 Likes

sorry to bring back an old topic, I know I could also just edit the menu entry like I did some other times, but it seems odd that I don’t have /etc/profile.d/mozilla-common.sh
Should I do something to create it? xdg-desktop-portal and xdg-desktop-portal-kde were already installed.

Creating the file is not difficult. :wink: Open up a terminal window and issue the following command… :arrow_down:

su -

Enter the root user’s password. Then issue the following two commands… :arrow_down:

echo 'export MOZ_PLUGIN_PATH="/usr/lib/mozilla/plugins"' >> /etc/profile.d/mozilla-common.sh
echo 'export GTK_USE_PORTAL=1' >> /etc/profile.d/mozilla-common.sh

Thank you very much for your reply, it worked! Though I still don’t understand why I didn’t have the file in there :sweat_smile:
Anyway, I think the second command didn’t work because of an extra '
I changed it with echo ’export GTK_USE_PORTAL=1' >> /etc/profile.d/mozilla-common.sh
I’m still learning basic commands in Linux so if I mistakenly corrected you I apologize in advance.

2 Likes

That was a typo on my part, and I missed it. Thank you for noticing. :+1:

I’ve corrected it now in my post. :slight_smile:

2 Likes