Command for toggling Xfce4-panel

After installing plank and realizing its advantages, I decided to fully close Xfce4-panel, but shortly after I noticed there are some items that cannot be displayed on Plank, so I had to re-initiate Panel again, and that is always accompanied with delays.

Is there any command for toggling panel? (hiding and unhiding)

What are some of these items?
Plank, of course, works a bit different than the Xfce4 panel - but it should be able to provide the same functionality.

… or not (or not easily) - that might be one of the reasons for the panel’s very existence :wink:

Panel items can’t be displayed on Plank - they are panel items …
but the same functionality probably can be re-created

Pressing Ctl + M brings up the big app menu.

Xfce panel can be set to Always hidden with this command:

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -t uint -s 2

Or Intelligently hidden by changing the final value 2 to 1
Or Never hidden by changing the final value to 0
xfce:xfce4-panel:preferences [Xfce Docs]

xfconf-query option -T or --toggle only works with boolean values having 2 states, not with unsigned integer (uint) values

1 Like

it would be greatly appreciated if you tell me how to embed these items in plank :slightly_smiling_face:

Keyboard Language Indicator
Network Manager
Audio Control Plugin
Timeout Plugin
Xfce4 Timer

… all of these can be called via command line - they do have names and are distinct applications

I do not know how Plank works or is configured - I just tried it … years ago.

so:
I cannot just provide you with the commands to use and/or the description where to implement it in Plank

I was essentially just trying to elicit information from you on what you are having trouble with to do with Plank

… that would otherwise … just work ™ with the native Xfce panel.

Other people may be able to guide you.
I can’t.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

I made a little script to toggle hiding/unhiding the xfce panel. I found the code here that I modified for this use case, but I guess it could be modified for any possible use case.

So here is the bash script (saved as togglepanel.sh):

current_panelsetting=$(xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior)


if [[ $current_panelsetting == 0 ]]; then
    xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -t uint -s 2
else 
    xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -t uint -s 0
fi

Then in Keyboard settings tab Application shortcuts, you click add, click on the file browse icon and select the bash script, then press the preferred shortcut key.

Maybe it’s even possible to toggle between all 3 settings by modifying the script and add an ifelse command or something.

Edit: I just noticed that I’m posting in the Manjaro xfce forum, while I forgot I just switched to Mint xfce for the moment (no good reason). I just tested via a Manjaro live-usb boot and it works there as well.
The only difference is that the first panel in Mint is panel-1, while in Manjaro it’s panel-0 (why???). I already modified the above code block so it’s correct for Manjaro xfce.

I’ve merged the threads. :wink:

2 Likes

Script should have a shebang on first line - #!/bin/bash

https://www.shellcheck.net/

[Line 1:](javascript:setPosition(1, 1))
current_panelsetting=$(xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior)
^-- [SC2148](https://www.shellcheck.net/wiki/SC2148) (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
2 Likes