1

Is it possible, in Debian Stretch, to combine the XFCE desktop with lxpanel from LXDE (instead of xfce4-panel)?

There are troubles with starting it properly (both panels, no panel, crashes, ...) as well as all menu entries missing.

1

Yes, it is possible, however it is not really straightforward.

Steps to get it to work:


Installing

As usual, a simple

apt-get install lxpanel

in a terminal as root should suffice.

Do not attempt to remove xfce4-panel - it will remove too much because of dependencies.


First init

After installing, start it manually one time from the terminal just with

lxpanel

It should show the panel and the main menu button correctly already, however the menu content will be nonsense.

Furthermore, starting it the first time creates some directories that are needed further down.


Logout menu

After terminating the panel with Ctrl-C again, the action for the logout menu line must be changed, as the default is a program that belongs to the LXDE desktop.
For this, create a file ~/.config/lxpanel/default/config with following content:

[Command]
Logout=xfce4-session-logout
Terminal=uxterm

As seen, in the last line you can also set your preferred terminal emulator.


Panel start script

For several reasons, a shell script is helpful that XFCE will later use to start lxpanel, instead of starting it directly. Create a file, and make it executable (chmod +x), with:

#!/bin/bash

XDG_MENU_PREFIX=lxde-
export XDG_MENU_PREFIX

linecount="$(ps aux | grep xfdesktop | grep Sl | wc -l)"
while [[ "linecount" -lt 0 ]]; do
    sleep 0.1
    linecount="$(ps aux | grep xfdesktop | grep Sl | wc -l)"
done
sleep 0.1

lxpanel &

Explanation:

The first section is necessary to get the panels menu show all normal menu entries (other than "Run" and "Logout"). Xfce by default sets the different value xfce- which doesn't help here.

In the next section, the script waits until xfdesktop is started, and not only started but in the "Sl" process state - which it will be usually after initializing.
Reason: While Xfce's panel doesn't seem to have problems if the desktop isn't ready, lxpanel more or less crashes in such cases (keeps running but shows only a grey bar). And when the panel will be started during Xfce start, there is indeed no guarantee that the desktop is ready.

Finally, lxpanel is then started.


Disabling Xfce's panel

First double-check if, in the file /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml, xfce4-panel is in the "Client2_Command" section. If not, adapt the number accordingly in the next command.

Now, set it to the dummy program /bin/true, to prevent starting the panel, with following command:

xfconf-query -c xfce4-session -p /sessions/Failsafe/Client2_Command -t string -sa /bin/true

Do not use the new shell script from above instead of /bin/true. If you use the saved-session feature of Xfce (eg. with the checkbox in the logout/shutdown dialog), starting again after saving would not start the panel.

Also do not edit xfce4-session.xml directly - it is for all users (the command just changes it for the current account), and there is some caching issue with xfconf that could prevent file changes from being applied.


Automatic start of lxpanel

Finally, start the program xfce4-session-setting. There in the third tab, you can add an entry for the shell script that will be started always together with Xfce (independent of sessions).


Btw., using Pcmanfm as default file manager is easier:
After installing pcmanfm, just change the default program in exo-preferred-applications.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.