Pimp Your XMonad #2: SmartBorders

This is a quick one. The focused window border is sometimes unnecessary, particularly when using Full or Tabbed layouts, since only one window is visible. XMonad.Layout.NoBorders was built to fix this.

The simplest option is the noBorders modifier, which will simply never show the border on the layouts it is applied to. It is typically applied thus:

layoutHook = ... ||| noBorders Full ||| ... ||| noBorders Tabbed ||| ...

Using it on a layout that shows multiple windows, such as Tall, would be a bad idea. But what about Tall with only one window? There is also the smartBorders modifier that will hide the borders under either of two conditions:

  • There is only one screen and only one window. (Note that on a Xinerama setup, this will never be true.)
  • A floating window covers the entire screen (great for mplayer, probably the largest use case)

Since smartBorders handles all layouts, even those that can have multiple windows, it is best applied to your whole layoutHook:

layoutHook = avoidStruts $ ... $ smartBorders $ ... ||| tiled ||| ...

Adding to core
It has been argued that SmartBorders should be in core, and even be the default behaviour. The main argument against this is that it could be confusing, and that it is rather straightforward to set up. For now, setting up smartBorders is easy, and improves the fullscreen video experience.

About these ads

One Response to Pimp Your XMonad #2: SmartBorders

  1. Yeah, to explain the syntax a bit more, when you have a list of layouts, like “tiled ||| Mirror tiled ||| Full”, you want to apply the smartBorders transformation to the whole shebang. You can do that either with parentheses, like “smartBorders (tiled ||| Mirror tiled ||| Full)” or with syntactic sugar, use a dollar-prefix-thingie “smartBorders $ tiled ||| Mirror tiled ||| Full”. You can chain dollar-prefix-thingies, so that “a $ b $ c $ d ||| e ||| f” == “a (b (c (d ||| e ||| f)))”. Boo, close-parentheses.

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.

%d bloggers like this: