Can I unhide the panel in Xfce using a key press rather than using mouse cursor hover to reveal it?

I would like to be able to unhide the Xfce panel by pressing a key instead of placing the mouse cursor at the edge of the screen.

I'm running Xubuntu 12.04 but updated to Xfce 4.10


Solution 1:

Take the following commands and bind them to separate Super-key combinations:

Commands for Xfce 4.12 through Xfce 4.14:

The following commands are now used to set the auto-hide properties:

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

Commands for Xfce 4.10:

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

Update: 12/09/2018: As mentioned in the comments, the above commands are no longer supported.

Command Values:

The value '0' is used for 'never' auto-hide. Value '1' is for 'intelligently' auto-hiding the panel, and '2' is used to set the value to 'always' auto-hide.

Setting the key-bindings:

This can be done by either selecting, Applications Menu → Settings → Keyboard → Application Shortcuts, or by running xfce4-keyboard-settings from the command line(Ctrl+Alt+t).

I've bound the first command to Super+u (to 'unhide' the panel). For the second command, I am binding Super+h (to 'hide' the panel).

As you can see in the commands above, the behavior is only changed on a single panel(In this case, panel-0 is being modified).

You may notice a slight delay while the panel changes state.

More details on the xfconf-query command can be found in the Xfce documentation or from this thread in the Xfce forum.

Solution 2:

Try this workaround:

Install xte and xdotool with sudo apt-get install xdotool xautomation

You can use xdotool to find the x,y coordinates of the mouse. Open a terminal type xdotool getmouselocation then move the mouse somewhere where it will activate the panel and hit enter. You will get some output like:

findclient: 62914741
findclient: 6291474  
x:1282 y:1079 screen:0 window:62914741  

What's important here is: x:1282 y:1079, which gives us the x,y coordinates of the mouse.

Now type xte 'mousemove 1282 1079' (replacing 1282 1079 with the coordinates you got earlier). That should move the mouse where you want.

You can use xbindkeys to bind this command to a key on the keyboard. I can add instructions upon request or you can set it in Xubuntu's keyboard settings.