Last active
January 25, 2023 05:05
-
-
Save LSLeary/72add95f8bbc16c9362d85dd8680cba5 to your computer and use it in GitHub Desktop.
Strut-avoiding scratchpads?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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