Skip to content →

True fullscreen in xmonad

For a long time, I have been dealing with a minor issue that has prevented fullscreen applications from displaying in a correct 16:10 resolution (or other standard resolution). This problem can be caused by xmobar occupying the dock area in my primary workspace. This problem can also be caused by window borders occupying extra pixels. In Starcraft II in Arch, xmonad, I modified the resolution of the wine desktop to account for the dock area and window borders.

Messing with the resolution hasn’t been required for a while now, but today I got around to fixing the problem while getting Skyrim running in Linux.

To display windows as true fullscreen in a workspace, use the following layouts.

import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
-- ...
myLayout = avoidStruts (
    Tall 1 (3/100) (1/2) |||
    Mirror (Tall 1 (3/100) (1/2))) |||
    noBorders (fullscreenFull Full)

In this configuration, the Tall and Mirror Tall layouts avoid the dock area, because they are within avoidStruts. Since noBorders (fullscreenFull Full) is not within avoidStruts, it allows windows to overlap the dock area. The noBorders layout, as the name implies, removes borders from the given layouts.

Once enabled, cycling through layouts enables a true fullscreen layout that occupies the entire workspace, hiding borders and dock areas. Each window is rendered fullscreen, and windows can be cycled through as usual.

Published in Uncategorized

  • dividebyzero

    Thanks for that , I use a bright red 1-pixel border, and it was impossible to watch Netflix! 🙂