Vala Panel AppMenu is a global menu panel applet for Xfce, MATE and Vala panels, which uses unity-gtk-module as its backend, and it works with all the applications supported by Unity's AppMenu.
Here's an Ubuntu MATE 16.10 screenshot as well:
- when no window is focused / the desktop is empty, a menu containing "Desktop" and "Files" is displayed by the Vala AppMenu applet. These menu items don't work, at least in Ubuntu, and using them can cause the Xfce / MATE panel to crash;
- Qt5 supports the AppMenu feature by default, without using any additional packages (I'm not sure which version introduced this feature), however, there's a bug with this and Vala AppMenu which causes the global menu for Qt5 applications to be displayed for a few seconds after the app is closed. This doesn't occur if the appmenu-qt5 package is installed though;
- MATE only: GTK2 applications have the menu displayed on both the panel and in the application window. If someone can find a way to solve this, please let us know in the comments!;
- MATE only: there's no easy way of moving the applet to the desired position, but it can be done using Dconf Editor;
- there's no way of changing the global menu font color, and that can be problematic with some themes. For example, the menu font is dark on a dark panel background using the default Xubuntu 16.04 theme (Greybird). This doesn't occur with Numix GTK theme (which is installed by default in Xubuntu) or Greybird in Xubuntu 16.10.
You may also want to check out the Vala Panel AppMenu issues page on GitHub.
Install and set up Vala AppMenu in Ubuntu (MATE/Xubuntu) or Linux Mint (Xfce) via PPA
If you don't use Ubuntu or Linux Mint, you can grab the Vala Panel AppMenu source from GitHub.
Arch Linux users can install Vala Panel AppMenu via AUR.
For Ubuntu or Linux Mint, see the instructions below.
sudo add-apt-repository ppa:webupd8team/mate
sudo apt update
Then, install the Vala AppMenu plugin / applet:
- for Xfce (Xubuntu 16.10, 16.04 / Linux Mint Xfce 18.x):
sudo apt install xfce4-vala-appmenu-plugin unity-gtk3-module unity-gtk2-module appmenu-qt appmenu-qt5
- for MATE (Ubuntu MATE 16.10):
sudo apt install mate-applet-vala-appmenu unity-gtk3-module unity-gtk2-module appmenu-qt appmenu-qt5
xfconf-query -c xsettings -p /Gtk/ShellShowsMenubar -n -t bool -s true
xfconf-query -c xsettings -p /Gtk/ShellShowsAppmenu -n -t bool -s true
2.B. for MATE, you'll need to edit the ~/.config/gtk-3.0/settings.ini file (if this file doesn't exist, create it) and in this file, add the following under "[Settings]":
gtk-shell-shows-app-menu=true
gtk-shell-shows-menubar=true
Here are step by step instructions for doing this. Firstly, create the ~/.config/gtk-3.0/ folder in case it doesn't exist, by using the following command:mkdir -p ~/.config/gtk-3.0/
Then open ~/.config/gtk-3.0/settings.ini with Pluma text editor:pluma ~/.config/gtk-3.0/settings.ini
If this file has a "[Settings]" section, paste under it the following:gtk-shell-shows-app-menu=true
gtk-shell-shows-menubar=true
If the file is empty, paste the following in this file:[Settings]
gtk-shell-shows-app-menu=true
gtk-shell-shows-menubar=true
... and save the file.Unfortunately, for MATE, this will not disable the menu from being displayed in app windows for GTK2 (I mentioned this in the issues section above).
3. Restart the session (logout, then log back in).
4. Add the Vala AppMenu applet to the panel (and how to change its position on the MATE panel).
sudo apt install dconf-editor
Next, launch Dconf Editor, navigate to org > mate > panel > objects and in the "objects" tree, you should see some items called "object-1", "object-2" and so on. Start from the last object and see which has the "applet-iid" value set to "AppMenuAppletFactory:AppMenuApplet".
Note: you may have multiple applets ("object-1", "object-2", etc.) with the "applet-iid" value of "AppMenuApplet..." - in that case you'll need to change the settings for the last one (the higher number).
mate-panel --replace &
5. Optional: enable Vala Appmenu (global menu) for Firefox and Thunderbird.
By default, Vala AppMenu will only display the Thunderbird and Firefox Unity actions (quicklists) on the panel. To enable the full Firefox and Thunderbird menu on the panel, you must launch Firefox and Thunderbird with "UBUNTU_MENUPROXY=0".
You can do this automatically (by copying the Firefox and Thunderbird .desktop files from /usr/share/applications to ~/.local/share/applications/ so they are not overwritten when they receive updates, and modify the .desktop files there) for both Firefox and Thunderbird, by using the commands below:
mkdir -p ~/.local/share/applications/
cp /usr/share/applications/firefox.desktop ~/.local/share/applications/
sed -i 's/^Exec=/Exec=env UBUNTU_MENUPROXY=0 firefox %u/' ~/.local/share/applications/firefox.desktop
cp /usr/share/applications/thunderbird.desktop ~/.local/share/applications/
sed -i 's/^Exec=/Exec=env UBUNTU_MENUPROXY=0 thunderbird %u/' ~/.local/share/applications/thunderbird.desktop
Undo the changes
Below you'll find the exact steps required to undo the changes made by following the instructions mentioned above.
1. Remove Vala AppMenu:
sudo apt purge xfce4-vala-appmenu-plugin mate-applet-vala-appmenu
If you are sure (Important! don't remove these packages if you also use Unity) that the Unity GTK module and AppMenu packages are not used by any other packages on your system, also purge them by using the following command:
sudo apt purge unity-gtk3-module unity-gtk2-module appmenu-qt appmenu-qt5
2. Undo the MATE/Xfce menu disable settings
2.A. For Xfce, use the following commands:
xfconf-query -c xsettings -p /Gtk/ShellShowsMenubar -n -t bool -s false
xfconf-query -c xsettings -p /Gtk/ShellShowsAppmenu -n -t bool -s false
2.B. For MATE, open ~/.config/gtk-3.0/settings.ini with a text editor - the command below uses Pluma to open this file:
pluma ~/.config/gtk-3.0/settings.ini
And from this file, remove the following two lines:gtk-shell-shows-app-menu=true
gtk-shell-shows-menubar=true
If this file was created by following the instructions in this article (was empty or it didn't exist before), you can simply remove it by using the following command:rm ~/.config/gtk-3.0/settings.ini
3. Restart the session (logout, then log back in)
4. If you applied the optional Thunderbird and Firefox tweaks mentioned above, you can undo this step by simply removing their .desktop files from ~/.local/share/applications/. To do this from a terminal, use the following commands:
rm ~/.local/share/applications/firefox.desktop
rm ~/.local/share/applications/thunderbird.desktop