helloSystem / hello

Desktop system for creators with a focus on simplicity, elegance, and usability. Based on FreeBSD. Less, but better!
2.29k stars 56 forks source link

Check xfce4-appmenu-plugin for global menus #11

Closed probonopd closed 3 years ago

probonopd commented 4 years ago
sudo apt-get update
sudo apt-get -y install xfce4-appmenu-plugin

Add "AppMenu Plugin" to the panel.

This is an Application Menu (Global Menu) plugin. It is built using the Unity protocol and libraries and provides all features found in the Unity implementation.

Also check out the Unity protocol and libraries and see if we can use this in a pure Qt desktop.

probonopd commented 4 years ago

It does work e.g., with AppImages of Qt-based applications:

probonopd commented 4 years ago

It also works for GoLang (Java based):

image

probonopd commented 4 years ago

However, I could not get it to work for Firefox yet, which is a pity:

image

probonopd commented 4 years ago

It even works for the Scribus Nightly AppImage which bundles practically everything:

image

So this seems to be a really robust, interesting solution

probonopd commented 4 years ago

But then, it does not work for the Inkscape AppImage, a Gtk based application. Why?

Didn't Inkscape have global menus in Ubuntu Unity?

probonopd commented 4 years ago

I don't quite understand Ubuntu's terminology, what does "indicator" mean? Is a way to say/get "global menu bar at the top of the screen"?

This code seems to be related: https://launchpad.net/indicator-appmenu

probonopd commented 4 years ago

It works for the Xfce desktop itself:

image

But not for its own Thunar file manager:

image

_Why?__

probonopd commented 4 years ago

It seems that for MATE, one needs a separate plugin:

https://packages.debian.org/buster/mate-applet-appmenu

aguslr commented 4 years ago

For this to work with XFCE applications (Thunar, Parole, Ristretto, etc.), it seems Appmenu needs to be enabled [1][2]:

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 "unity-gtk-module"

thunar

For good measure, it'd be a good idea to do add the following:

gtk-modules="unity-gtk-module"
gtk-modules=unity-gtk-module
gtk-shell-shows-app-menu=true
gtk-shell-shows-menubar=true
if [ -n "$GTK_MODULES" ]; then
    GTK_MODULES="${GTK_MODULES}:unity-gtk-module"
else
    GTK_MODULES="unity-gtk-module"
fi

if [ -z "$UBUNTU_MENUPROXY" ]; then
    UBUNTU_MENUPROXY=1
fi

export GTK_MODULES
export UBUNTU_MENUPROXY

This is for Ubuntu-based distros, otherwise just replace unity-gtk-module with appmenu-gtk-module.

aguslr commented 4 years ago

Even with all these changes, GTK AppImages don't seem to work (e.g. GIMP and Inkscape):

gimp_appimage

inkscape_appimage

Although LibreOffice's AppImage does work:

libreoffice_appimage

aguslr commented 4 years ago

For comparison, these are GIMP and Inkscape working when using the distro's packages:

inkscape

gimp

aguslr commented 4 years ago

Regarding Firefox, I know for a fact that it used to work with older LTS versions of Ubuntu since they used a patched version. Here you can see it working in Ubuntu 18.04 LTS:

firefox_old

But alas, it doesn't work in Ubuntu 20.04 LTS:

firefox

For reference, you can find some patched version in Arch's User repository [1][2], although I haven't tested them.

aguslr commented 4 years ago

Just extracted Arch's firefox-appmenu-bin [1] in Ubuntu 20.04 LTS and it works as expected:

firefox_appmenu

Could this be packaged as an AppImage or pull and apply the patch before packaging?

aguslr commented 4 years ago

BTW, all this magic seems to be achieved by using Dbusmenu [1]. I gather that the AppImages that don't have a working AppMenu are not packaging the appropriate dbusmenu libraries.

probonopd commented 4 years ago

@aguslr you rock. Would you like to start working on this with me for real?

probonopd commented 3 years ago

Focusing on Qt-based https://github.com/probonopd/panda-statusbar for now which is basically the KDE Plasma global menu system without Plasma dependencies.

probonopd commented 2 years ago

@FreezyKaif do you realize that you are asking in a helloSystem bugtracker?

While I can't help you debug this issue on what certainly seems not to be helloSystem, here is the summary of my research into how Global Menus work: https://hellosystem.github.io/docs/developer/menu.html

Maybe it is helpful as a starting point for your debugging. Good luck! (Maybe you'd just like to try helloSystem where the global menu is a first-class citizen and enabled by default?)