Skip to content

Instantly share code, notes, and snippets.

@LSLeary
Last active January 25, 2023 05:05
Show Gist options
  • Save LSLeary/72add95f8bbc16c9362d85dd8680cba5 to your computer and use it in GitHub Desktop.
Save LSLeary/72add95f8bbc16c9362d85dd8680cba5 to your computer and use it in GitHub Desktop.
Strut-avoiding scratchpads?
module Strutless where
import XMonad
import XMonad.StackSet (RationalRect)
import qualified XMonad.StackSet as W
import Data.Set (Set)
import XMonad.Util.Types (Direction2D)
import XMonad.Util.Rectangle (toRatio)
import XMonad.Util.NamedScratchpad (customFloating)
import XMonad.Hooks.ManageDocks (calcGap)
strutlessRR :: Set Direction2D -> X RationalRect
strutlessRR ds = do
calc <- calcGap ds
SD rect <- gets (W.screenDetail . W.current . windowset)
pure (calc rect `toRatio` rect)
strutlessFloating :: Set Direction2D -> ManageHook
strutlessFloating ds = liftX (strutlessRR ds) >>= customFloating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment