The officially official Devuan Forum!

You are not logged in.

#1 2021-10-09 22:23:58

fred43
Member
Registered: 2018-08-03
Posts: 13  

HOWTO: A fully functional xfce4-appmenu-plugin with lightdm + elogind.

Distro: Devuan-Testing (chimaera) soon to be the next stable release.

Ever tried to install this plugin on a pure sysv-init-system and you never got it to work as advertised? Maybe this HOWTO might come in handy.

You want to see a proof, here it is (a snippet from /var/log/syslog):

  • Oct  9 12:35:12 mars dbus-daemon[6220]: [session uid=1002 pid=6218] Activating service name='com.canonical.AppMenu.Registrar' requested by ':1.15' (uid=1002 pid=6338 comm="/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-2.0 ")
    Oct  9 12:35:12 mars dbus-daemon[6220]: [session uid=1002 pid=6218] Successfully activated service 'com.canonical.AppMenu.Registrar'

and

  • ~$ env | grep GTK_M
    GTK_MODULES=appmenu-gtk-module

The solution, bases on the motto "if you can't make it - fake it" and a still reasonably sane Lightdm and Xfce4-Core, is actually fairly simple. A purist might bark at it - but it does work flawlessly and should be "futureproof" for the whole of Chimaera's live-cicle.

On my box it does now take about 2 seconds longer to get from the login to the desktop. I am not too thrilled about that. Any feedback is welcome especially a better but tested solution. Please share. I would like to see this HOWTO to be the standard goto for devuan users experiencing problems with this plugin.

OK, here we go....in 4 easy steps.

Step 1

Packages required:

  • [INSTALL, DEPENDENCIES] appmenu-gtk-module-common:amd64 0.7.6-2
    [INSTALL, DEPENDENCIES] appmenu-gtk2-module:amd64 0.7.6-2
    [INSTALL, DEPENDENCIES] appmenu-gtk3-module:amd64 0.7.6-2
    [INSTALL, DEPENDENCIES] appmenu-registrar:amd64 0.7.6-2
    [INSTALL, DEPENDENCIES] libappmenu-gtk2-parser0:amd64 0.7.6-2
    [INSTALL, DEPENDENCIES] libappmenu-gtk3-parser0:amd64 0.7.6-2
    [INSTALL, DEPENDENCIES] libdbusmenu-gtk4:amd64 18.10.20180917~bzr492+repack1-2
    [INSTALL, DEPENDENCIES] vala-panel-appmenu-common:amd64 0.7.6+dfsg1-3
    [INSTALL] xfce4-appmenu-plugin:amd64 0.7.6+dfsg1-3

and add the plugin to the panel.

Step 2

As user:

$ cp /etc/xdg/xfce4/xinitrc ~/.config/xfce4/
$ nano ~/.config/xfce4/xinitrc

and paste the following snippet into the file....

#-------Start-fred
# Let 'xfce4-session' do the magic to get it added to the
# desktop-environment without being locked out of a session.
# Downside, adds 1-3 secs in exchange for a bit more screen realestate!
#
# Do we have to do it?
if [ -x /usr/libexec/vala-panel/appmenu-registrar ]; then
  # Don't drop the ball if additional gtk-modules have been sneaked in
  if [ -z "$GTK_MODULES" ]; then
    GTK_MODULES="appmenu-gtk-module"
  else
    GTK_MODULES="$GTK_MODULES:appmenu-gtk-module"
  fi
  export GTK_MODULES
fi
#-------End-fred

...just before the following line (near the end of the file)

# check if we start xfce4-session with ck-launch-session. this is only
# ....
# ....

and save and exit nano

Step 3

As root:

# nano /etc/lightdm/lightdm.conf

Under the section

[Seat:*]
...
...

change

session-setup-script=

to

session-setup-script=/etc/lightdm/scripts/activate-appmenu-bus

save and exit nano

then

# mkdir /etc/lightdm/scripts
# nano /etc/lightdm/scripts/activate-appmenu-bus

and paste the following into the file:

#!/bin/sh

# Needs to be run as 'root' and not as the 'USER'!!!
test -x /usr/libexec/vala-panel/appmenu-registrar || exit 0

/usr/libexec/vala-panel/appmenu-registrar

exit 0

save and exit nano and make the file executable (-rwxr-xr-x)!

Step 4 (Final)

A '/etc/init.d/lightdm restart' might be good enough but I recommend a shutdown because 'dbus' is involved.

Enjoy your global-menu.

-------------------

Side-Note:
After you got it working you will see in ~/.xsession-errors
or after a 'xfce4-panel -r' in the terminal the following:

Gtk-Message: 10:56:30.568: Failed to load module "colorreload-gtk-module"
Gtk-Message: 10:56:30.568: Failed to load module "window-decorations-gtk-module"

Ignore it, it is not relevant for the xfce4-appmenu-plugin to work properly in the Devuan-Environment. I think it is an Ubuntu/Kubuntu thingy because the appmenu-registrar gets registered under: 'com.canonical.AppMenu.Registrar' although it seems to expect to be registered under 'org.valapanel.AppMenu,Registrar' when invoked directly as a USER. Just another mystery (at least for me) in the changed linux-landscape of obfuscations.

Offline

Board footer