Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-10-31 10:56:13

michja
Member
Registered: 2017-10-31
Posts: 2

Change stacking order of xfce4-panel panels

Hey,

How can I change the stacking order of xfce4 panels?

I tried changing the order in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml but that doesn't work, the file reverts when I xfce4-panel -r

Cheers,
Michael

Last edited by michja (2017-10-31 10:56:39)

Offline

#2 2017-10-31 14:00:33

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 3,876

Re: Change stacking order of xfce4-panel panels

Hello and welcome.

You can't change the stacking order easily. I believe they are stacked in the order they created, by the panel number.

I tried changing the order in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml but that doesn't work, the file reverts when I xfce4-panel -r

This is because the settings are saved in memory by xfconf. Try editing the file when you are not logged in. Also make sure xfconf isn't still running when you log out (ps -ef | grep xfconf). If it still is, kill the process (known issue when running under systemd).

.

Another option you could use is wmctrl and a custom autostart script that pushes a certain panel or panels to the back (or brings them to the front). For this to work, you would need to have different panel geometries. Consider the following:

wmctrl -lG | grep xfce4-panel

...will list all the existing panels (plus the main panel instance). The 'G' in the wmctrl command displays the panel's geometry. Assuming that the panel you want to effect has a geometry of '136  15   160  32' (x, y, width, height), you could pick it out via:

wmctrl -lG | grep xfce4-panel | grep "136  15   160  32"

...and get it's WindowID via:

wmctrl -lG | grep xfce4-panel | grep "136  15   160  32" | awk '{print $1}'

Now, wmctrl lets you change the stacking order by sending a particular window to the front or to the back via the '-b add,above' or '-b add,below' parameters using the template "wmctrl -i -r <WIN> -b add,below".

Knowing the target panel's WindowID from the previous command, we can embed that command to retrieve the WindowID and send that panel to the back with a command like:

wmctrl -i -r $(wmctrl -lG | grep xfce4-panel | grep "136  15   160  32" | awk '{print $1}') -b add,below

You can put this command in a script (possible with a short delay to allow the panels to display on the screen) to change the stacking order:

#!/bin/bash

sleep 2

wmctrl -i -r $(wmctrl -lG | grep xfce4-panel | grep "136  15   160  32" | awk '{print $1}') -b add,below

Make the script executable and add it to your autostart entries.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

#3 2017-10-31 17:18:49

michja
Member
Registered: 2017-10-31
Posts: 2

Re: Change stacking order of xfce4-panel panels

Awesome. Option #1 sounds good.

Thanks

Offline

Board footer

Powered by FluxBB