Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run 12.04 with gnome-shell (so it looks like Gnome 2 with horizontal panels on the top and the bottom of the screen) with Xmonad.

What I want to do is create a keybinding that would toggle these panels, basically switching applications on the screen to fullscreen and back.

Can anyone tell me what should I write in xmonad.hs in order to achieve it? (I'm totally innocent of Haskell, unfortunately.)

share|improve this question
I changed "borders" to "panels" in your question since that's the term which is used – Sergey Aug 24 '12 at 10:18
Yes, thanks, I felt that something was wrong with wording. – shlema Aug 24 '12 at 10:55

Assuming you've setup your XMonad using gnomeConfig then the panels should be handled as struts.

In your xmonad.hs you then want to use the ManageDocks module.

The docs page provides the steps necessary to enable it but it surmounts to modifying your manageHook and layoutHook as follows:

import XMonad.Hooks.ManageDocks
manageHook = ... <+> manageDocks
layoutHook = avoidStruts (tall ||| mirror tall ||| ...)
        where tall = ResizableTall 1 (3/100) (1/2)

There already exists a key binding in XMonad to toggle struts: Mod+b is the default. If you're defining your own set of keybindings then you can add the following:

,((modm, xK_b     ), sendMessage ToggleStruts)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.