diff options
| author | Josh Rahm <rahm@google.com> | 2022-11-21 12:05:03 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-11-21 12:05:03 -0700 |
| commit | ee9be16599f20aef6d1d3fd15666c00452f85aba (patch) | |
| tree | 1aed66c1de2ce201463e3becc2d452d4a8aa2992 /src/Rahm/Desktop/Layout.hs | |
| parent | a1636c65e05d02f7d4fc408137e1d37b412ce890 (diff) | |
| download | rde-ee9be16599f20aef6d1d3fd15666c00452f85aba.tar.gz rde-ee9be16599f20aef6d1d3fd15666c00452f85aba.tar.bz2 rde-ee9be16599f20aef6d1d3fd15666c00452f85aba.zip | |
Format with ormolu.
Diffstat (limited to 'src/Rahm/Desktop/Layout.hs')
| -rw-r--r-- | src/Rahm/Desktop/Layout.hs | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/Rahm/Desktop/Layout.hs b/src/Rahm/Desktop/Layout.hs index 08bd8d1..0bfc0a3 100644 --- a/src/Rahm/Desktop/Layout.hs +++ b/src/Rahm/Desktop/Layout.hs @@ -1,42 +1,39 @@ module Rahm.Desktop.Layout where -import GHC.TypeLits - -import Data.Proxy (Proxy(..)) -import Control.Arrow (second) -import XMonad.Hooks.ManageDocks -import XMonad.Layout.Circle -import XMonad.Layout.Accordion import Control.Applicative -import XMonad.Layout.Spacing +import Control.Arrow (second) import Data.List +import qualified Data.Map as M +import Data.Proxy (Proxy (..)) import Data.Typeable (cast) -import XMonad.Layout.Spiral -import XMonad.Layout.ThreeColumns -import XMonad.Layout.Grid -import XMonad.Layout.Dishes -import XMonad.Layout.MosaicAlt -import XMonad.Layout.Fullscreen -import qualified XMonad.Layout.Dwindle as D -import XMonad.Layout -import XMonad.Layout.LayoutModifier -import XMonad -import XMonad.Core -import XMonad.Layout.NoBorders (smartBorders, noBorders) - -import Rahm.Desktop.Layout.CornerLayout (Corner(..)) +import GHC.TypeLits +import Rahm.Desktop.Layout.Bordering +import Rahm.Desktop.Layout.ConsistentMosaic +import Rahm.Desktop.Layout.CornerLayout (Corner (..)) +import Rahm.Desktop.Layout.Flip +import Rahm.Desktop.Layout.Hole import Rahm.Desktop.Layout.List -import Rahm.Desktop.Layout.ReinterpretMessage import Rahm.Desktop.Layout.Pop -import Rahm.Desktop.Layout.Flip -import Rahm.Desktop.Layout.Rotate import Rahm.Desktop.Layout.Redescribe -import Rahm.Desktop.Layout.Hole -import Rahm.Desktop.Layout.ConsistentMosaic -import Rahm.Desktop.Layout.Bordering - -import qualified Data.Map as M +import Rahm.Desktop.Layout.ReinterpretMessage +import Rahm.Desktop.Layout.Rotate import qualified Rahm.Desktop.StackSet as W +import XMonad +import XMonad.Core +import XMonad.Hooks.ManageDocks +import XMonad.Layout +import XMonad.Layout.Accordion +import XMonad.Layout.Circle +import XMonad.Layout.Dishes +import qualified XMonad.Layout.Dwindle as D +import XMonad.Layout.Fullscreen +import XMonad.Layout.Grid +import XMonad.Layout.LayoutModifier +import XMonad.Layout.MosaicAlt +import XMonad.Layout.NoBorders (noBorders, smartBorders) +import XMonad.Layout.Spacing +import XMonad.Layout.Spiral +import XMonad.Layout.ThreeColumns myLayout = fullscreenFull $ @@ -44,21 +41,20 @@ myLayout = mySpacing = spacingRaw True (Border 5 5 5 5) True (Border 5 5 5 5) True - mods = bordering . mySpacing . poppable . flippable . rotateable . hole myLayoutList = - layoutList $ - mods (reinterpretIncMaster $ spiral (6/7)) |: - mods (MosaicWrap $ modifyMosaic (MosaicAlt M.empty :: MosaicAlt Window)) |: - mods (reinterpretIncMaster $ Corner (3/4) (3/100)) |: - mods (Redescribe UsingTall (Tall 1 (3/100) (1/2))) |: - mods (Redescribe UsingThreeCol (ThreeCol 1 (3/100) (1/2))) |: - mods Grid |: - mods (Dishes 2 (1/6)) |: - mods (reinterpretIncMaster $ D.Dwindle D.R D.CW 1.5 1.1) |: - nil + layoutList $ + mods (reinterpretIncMaster $ spiral (6 / 7)) + |: mods (MosaicWrap $ modifyMosaic (MosaicAlt M.empty :: MosaicAlt Window)) + |: mods (reinterpretIncMaster $ Corner (3 / 4) (3 / 100)) + |: mods (Redescribe UsingTall (Tall 1 (3 / 100) (1 / 2))) + |: mods (Redescribe UsingThreeCol (ThreeCol 1 (3 / 100) (1 / 2))) + |: mods Grid + |: mods (Dishes 2 (1 / 6)) + |: mods (reinterpretIncMaster $ D.Dwindle D.R D.CW 1.5 1.1) + |: nil nLayouts :: Int nLayouts = layoutListLength myLayoutList @@ -70,30 +66,32 @@ nLayouts = layoutListLength myLayoutList -- "ForMosaic" is an instance of the Symbol kind. This is some neat type-system -- hacking one can do in Haskell. instance DoReinterpret "ForMosaic" where - -- IncMaster message reinterpretMessage _ (fromMessage -> Just (IncMasterN n)) = do - Just . SomeMessage <$> ( - if n > 0 - then expandPositionAlt - else shrinkPositionAlt) + Just . SomeMessage + <$> ( if n > 0 + then expandPositionAlt + else shrinkPositionAlt + ) -- ResizeMaster message reinterpretMessage _ (fromMessage -> Just m) = do - Just . SomeMessage <$> - (case m of - Expand -> expandPositionAlt - Shrink -> shrinkPositionAlt) + Just . SomeMessage + <$> ( case m of + Expand -> expandPositionAlt + Shrink -> shrinkPositionAlt + ) -- Messages that don't match the above, just leave it unmodified. reinterpretMessage _ m = return (Just m) instance DoReinterpret "IncMasterToResizeMaster" where reinterpretMessage _ (fromMessage -> Just (IncMasterN n)) = - return $ Just $ - if n > 0 - then SomeMessage Expand - else SomeMessage Shrink + return $ + Just $ + if n > 0 + then SomeMessage Expand + else SomeMessage Shrink reinterpretMessage _ m = return (Just m) modifyMosaic :: l a -> ModifiedLayout (ReinterpretMessage "ForMosaic") l a @@ -104,10 +102,12 @@ reinterpretIncMaster :: reinterpretIncMaster = ModifiedLayout ReinterpretMessage data UsingTall = UsingTall deriving (Read, Show) + instance Describer UsingTall Tall where newDescription _ (Tall mast _ _) _ = "Tall(" ++ show mast ++ ")" data UsingThreeCol = UsingThreeCol deriving (Read, Show) + instance Describer UsingThreeCol ThreeCol where newDescription _ (ThreeCol mast _ _) _ = "ThreeCol(" ++ show mast ++ ")" newDescription _ (ThreeColMid mast _ _) _ = "ThreeColMid(" ++ show mast ++ ")" |