Autohide xfce4-panel with a keybinding in Openbox

November 26, 2011

Since version 4.6, Xfce uses a settings editor, similar to Gnome’s gconf. You can edit the settings in xfconf from the command-line with its command-line utility xfconf-query. This is handy if you want to control certain aspects of Xfce through Openbox’ keybindings. On Loka, my desktop computer, I use Openbox as the window manager in Xfce, and use the xfce4-panel, which is set to be always visible. Occasionally, however, I want to hide the panel, and thanks to xfconf-query I can do that with a simple keybinding.

Here is what I use in the keyboard section of my rc.xml:

<keybind key="W-o">
<!--Autohide xfce4-panel-->
      <keybind key="h">
        <action name="Execute">
          <execute>xfconf-query -c xfce4-panel -p /panels/panel-0/autohide -s true</execute>
        </action>
      </keybind>
      <keybind key="S-h">
        <action name="Execute">
          <execute>xfconf-query -c xfce4-panel -p /panels/panel-0/autohide -s false</execute>
        </action>
      </keybind>
   </keybind>

This makes the Win+o+h keychain (auto)hide the xfce4-panel and Win+o+Shift+h make the panel visible again. (In my configuration, W-o starts the keychain for all Openbox and DE related keybindings)

Note that if you run more than one xfce4-panel, this keybinding will only hide the first panel (panel-0). If you want to hide a different panel, change /panels/panel-0/ to the appropriate value (/panel/panel-1/ for example). You can find out the panel number in the “Panel preferences” dialog (where “Panel 1″ will be named “panel-0″ in xfconf, “Panel 2″ will be “panel-1″, and so on), or you can check it in xfce4-settings-editor.

About these ads

One Response to “Autohide xfce4-panel with a keybinding in Openbox”

  1. spc said

    Hey!
    You simply rock!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 80 other followers