Created
August 18, 2018 01:38
-
-
Save anekos/0406625b4730b3287af42e4dc37735f7 to your computer and use it in GitHub Desktop.
avoidStruts が上手くいかないので、強引にステータスバーの領域をあける
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
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, TypeSynonymInstances, PatternGuards #-} | |
module Anekos.Lib.MyGaps ( | |
MyGaps(..), | |
myGaps | |
) where | |
import XMonad | |
import Graphics.X11 (Rectangle(..)) | |
import XMonad.Layout.LayoutModifier | |
import XMonad.Util.Types (Direction2D(..)) | |
import XMonad.Util.XUtils (fi) | |
import GHC.Word (Word32) | |
import Data.List (delete) | |
data MyGaps a = MyGaps () deriving (Read, Show) | |
instance LayoutModifier MyGaps Window where | |
modifyLayout g w r = runLayout w (applyGaps g r) | |
mainBarHeight, subBarHeight :: Word32 | |
mainBarHeight = 20 | |
subBarHeight = mainBarHeight | |
applyGaps :: MyGaps a -> Rectangle -> Rectangle | |
applyGaps _ (Rectangle x y 1920 1080) = Rectangle x y 1920 (1080 - mainBarHeight) | |
applyGaps _ (Rectangle x y 1080 1920) = Rectangle x (fi subBarHeight) 1080 (1920 - subBarHeight) | |
applyGaps _ r = r | |
myGaps :: LayoutClass l a => l a -> ModifiedLayout MyGaps l a | |
myGaps = ModifiedLayout $ MyGaps () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment