Getting XFCE Global Menu working on OpenBSD

    

One thing I miss from Mac OS user interface is the Global Menu that sits on the topbar and changes as you switch applications. It saves a bit of space on the screen. And it’s always on the same place which makes it easy to be reached wherever the app is.

After quite a lot of trial & errors, I could have the vala-panel-appmenu working on OpenBSD 7.0 using XFCE 4.16.

First of all, install a few additionnal (to xfce) packages.

# pkg_add git meson vala bamf gettext-tools

Then, clone the source repo, configure vala-panel for xfce and launch the compilation process.

# git clone https://gitlab.com/vala-panel-project/vala-panel-appmenu.git
# cd vala-panel-appmenu
# meson -Dxfce=enabled -Dbudgie=disabled -Dvalapanel=disabled            \
        -Dmate=disabled -Djayatana=disabled -Dappmenu-gtk-module=enabled \
        build
(...)
vala-panel-appmenu 0.7.6

  Subprojects
    appmenu-gtk-module: YES
    jayatana          : NO Feature 'jayatana' disabled
    registrar         : YES

Found ninja-1.10.2 at /usr/local/bin/ninja

# cd build
# ninja
# doas ninja install

You have to recompile the Glib schemas. If you don’t, XFCE will crash each time you try to activate appmenu-gtk-module.

# doas glib-compile-schemas /usr/local/share/glib-2.0/schemas

Finally, the Global Menu can be activated.

# xfconf-query -c xsettings -p /Gtk/ShellShowsMenubar -n -t bool -s true
# xfconf-query -c xsettings -p /Gtk/ShellShowsAppmenu -n -t bool -s true
# xfconf-query -c xsettings -p /Gtk/Modules -n -t string -s "appmenu-gtk-module

Be sure to have the bamf daemon started. I have a dedicated directive in my .xsession file.

/usr/local/libexec/bamf/bamfdaemon &

exec /usr/local/bin/startxfce4

Then, the AppMenu Plugin can be added to the XFCE panel.

After a week of testing, much software seem compatible with this plugin. Qt applications need the extra appmenu-qt software. As for now, I didn’t try compiling it. KeePassXC and Nextcloud Client keep their menu attached. Some other Qt, Tk or graphical Python apps either don’t bother AppMenu or make it crash. But I don’t really use them, so I don’t care.

PS: Thanks a lot Konstantin for helping me out !