Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-05-14 14:52:28

advice1010
Member
Registered: 2023-02-19
Posts: 121
LinuxChrome 130.0

Way to hide panel with a command

XFCE 4.20.x

OVERVIEW
Is there a command line command that can allow user to hide the panel
Panel - Display - Automatically Hide Panel = Always
and then one to revert this back to
Panel - Display - Automatically Hide Panel = Never
I put more specific details about the functionality I am looking for below.

RESEARCH RESULTS
In doing some research, I saw older posts elsewhere and apparently this was possible in the past because the setting was said to be a "boolean" but in newer versions this is said to have changed?

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

Value at the end can be 0  1   2

Someone else mentioned could also set as a toggle with this

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide -T

but these did not work for me


IDEAL FUNCTIONALITY
What I am really looking for is the simplest way (without need for extra applications) to do the following.
Would have to be some kind of Bash script I imagine.
Looking to do this in other programs but for this example lets just use Thunar.
I would like to be able to set it up where if I was to launch Thunar, to have the Panel change to autohide = "Always".
Then when that instance of Thunar is closed the Panel would change back to autohide = "Never"

Probably not possible so I guess the next best thing would be a toggle based hotkey set in Keyboard - Application Shortcuts.
As mentioned this in past was apparently possible but not sure if it is anymore?

Thank you to anyone who reads this

Offline

#2 2025-05-14 17:18:19

Tamaranch
Member
From: France
Registered: 2020-12-31
Posts: 389
Website
LinuxFirefox 138.0

Re: Way to hide panel with a command

Yes it's possible, you need something like devilspie, which tracks the opening of new windows and executes actions according to matching criteria (e.g. based on the window title). In this case the action would be the xfconf-query command you mention with the right value (never 0, always 2).

Offline

#3 2025-05-14 20:20:37

Misko_2083
Member
Registered: 2015-10-13
Posts: 223
Website
LinuxFirefox 128.0

Re: Way to hide panel with a command

Tamaranch wrote:

Yes it's possible, you need something like devilspie, which tracks the opening of new windows and executes actions according to matching criteria (e.g. based on the window title). In this case the action would be the xfconf-query command you mention with the right value (never 0, always 2).

I use my own app. toggle-xfce4-panel https://gist.githubusercontent.com/Misk … e4-panel.c
It can hide and show multiple panels 

./toggle-xfce4-panel <panel_number> [<panel_number> ...]

uaimuR5.gif

Last edited by Misko_2083 (2025-05-14 20:24:00)


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#4 2025-05-14 22:15:40

CwF
Moderator
Registered: 2018-01-28
Posts: 310
LinuxFirefox 128.0

Re: Way to hide panel with a command

Misko_2083 wrote:

I use my own app

from your code;

* Toggle the visibility of a panel window (minimize or restore).

Does this imply the panel exist even while hidden?

This, or with xfconf-query and even 'Panel Profiles'  I've tried to make a more dynamic layout that can adjust to a situation. Always I run into the same problem. Either the panel exist and is sucking resources without being visible or used, or it doesn't exist until called for, yet needs interaction to inilialize.

Offline

#5 2025-05-14 23:01:31

Misko_2083
Member
Registered: 2015-10-13
Posts: 223
Website
LinuxFirefox 128.0

Re: Way to hide panel with a command

CwF wrote:
Misko_2083 wrote:

I use my own app

from your code;

* Toggle the visibility of a panel window (minimize or restore).

Does this imply the panel exist even while hidden?

This, or with xfconf-query and even 'Panel Profiles'  I've tried to make a more dynamic layout that can adjust to a situation. Always I run into the same problem. Either the panel exist and is sucking resources without being visible or used, or it doesn't exist until called for, yet needs interaction to initialize.

Yes, you are right about everything..

But I've had another approach and just rewritten this app to toggle between the autohide modes.
This way it will not depend on X11.

https://gist.github.com/Misko-2083/cc42 … cb43564084

toggle-xfce4-panel
A command-line C program to manage XFCE4 panel autohide behavior
Handles up to 100 panels, assumes integer IDs.
Portable for XFCE4 systems with libxfconf-0 and GLib.

toggle-xfce4-panel controls the autohide settings of XFCE4 panels using the xfconf system.
It queries, sets, toggles, or resets the autohide-behavior property, which has three modes:

  • 0 (never): Panel is always visible.

  • 1 (intelligently): Panel hides when a window overlaps, reappears when needed.

  • 2 (always): Panel autohides, appears on mouse hover.

Features

  • Query: Display current autohide settings for specific or all panels.

  • Set: Configure to never, intelligently, or always.

  • Toggle: Cycle through modes (never → intelligently → always → never).

  • Reset: Restore to never.

  • All Panels: Apply operations to all panels with "all".

  • Error Handling: Reports invalid panels, non-integer properties, and xfconf errors.

Usage

./toggle-xfce4-panel <panel_number> [<panel_number> ...]
./toggle-xfce4-panel all
./toggle-xfce4-panel --set=<never|intelligently|always> <panel_number> [<panel_number> ...] | all
./toggle-xfce4-panel --query <panel_number> [<panel_number> ...] | all
./toggle-xfce4-panel --reset <panel_number> [<panel_number> ...] | all

Examples:

  • Query all panels:

    ./toggle-xfce4-panel --query all
    Panel 1 autohide is set to intelligently
    Panel 2 autohide is set to always
  • Set panel 1 to intelligently:

    ./toggle-xfce4-panel --set=intelligently 1
    Panel 1 autohide set to intelligently
  • Toggle panel 2:

    ./toggle-xfce4-panel 2

    Output (if always): Panel 2 autohide set to never

  • Toggle panels 1 and 2:

    ./toggle-xfce4-panel 1 2
    ./toggle-xfce4-panel --set=never 1 --set=always 2
    Panel 1 autohide set to never
    Panel 2 autohide set to always
  • Reset all:

    ./toggle-xfce4-panel --reset all

    Output: Panel 1 autohide reset to never
    Panel 2 autohide reset to never

Dependencies

  • libxfconf-0-dev: For xfconf configuration.

  • libglib2.0-dev: For GValue, GPtrArray, and utilities.

Install (Debian-based):

sudo apt-get install libxfconf-0-dev libglib2.0-dev

Compile:

gcc toggle-xfce4-panel.c -o toggle-xfce4-panel -lxfconf-0 -Wall `pkg-config --cflags --libs libxfconf-0 glib-2.0`

Just fixed some bugs. Option "all" made it complicated, but it is neat to have something like that.
If you find more bugs please report.
https://gist.github.com/Misko-2083/cc42 … cb43564084

My dev libs are a bit older on debian.

apt-cache policy libxfconf-0-dev
libxfconf-0-dev:
  Installed: 4.18.0-2
  Candidate: 4.18.0-2
  Version table:
 *** 4.18.0-2 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status

Last edited by Misko_2083 (2025-05-15 00:44:29)


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 9 queries executed - Memory usage: 562.59 KiB (Peak: 579.43 KiB) ]