mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-06 07:01:52 -07:00
define defaultLayout in Config.hs.
This commit is contained in:
15
Config.hs
15
Config.hs
@@ -90,8 +90,19 @@ borderWidth :: Dimension
|
|||||||
borderWidth = 1
|
borderWidth = 1
|
||||||
|
|
||||||
-- |
|
-- |
|
||||||
-- The default set of tiling algorithms
|
-- A list of layouts which, in addition to the defaultLayouts, xmonad can
|
||||||
|
-- deserialize.
|
||||||
|
possibleLayouts :: [SomeLayout Window]
|
||||||
|
possibleLayouts = [defaultLayout
|
||||||
|
-- Extension-provided layouts
|
||||||
|
] ++ defaultLayouts
|
||||||
|
|
||||||
|
-- |
|
||||||
|
-- The default tiling algorithm
|
||||||
--
|
--
|
||||||
|
defaultLayout :: SomeLayout Window
|
||||||
|
defaultLayout = SomeLayout $ LayoutSelection defaultLayouts
|
||||||
|
|
||||||
defaultLayouts :: [SomeLayout Window]
|
defaultLayouts :: [SomeLayout Window]
|
||||||
defaultLayouts = [ SomeLayout tiled
|
defaultLayouts = [ SomeLayout tiled
|
||||||
, SomeLayout $ Mirror tiled
|
, SomeLayout $ Mirror tiled
|
||||||
@@ -142,7 +153,7 @@ keys = M.fromList $
|
|||||||
, ((modMask .|. shiftMask, xK_c ), kill) -- %! Close the focused window
|
, ((modMask .|. shiftMask, xK_c ), kill) -- %! Close the focused window
|
||||||
|
|
||||||
, ((modMask, xK_space ), sendMessage NextLayout) -- %! Rotate through the available layout algorithms
|
, ((modMask, xK_space ), sendMessage NextLayout) -- %! Rotate through the available layout algorithms
|
||||||
, ((modMask .|. shiftMask, xK_space ), setLayout $ SomeLayout $ LayoutSelection defaultLayouts) -- %! Reset the layouts on the current workspace to default
|
, ((modMask .|. shiftMask, xK_space ), setLayout defaultLayout) -- %! Reset the layouts on the current workspace to default
|
||||||
|
|
||||||
, ((modMask, xK_n ), refresh) -- %! Resize viewed windows to the correct size
|
, ((modMask, xK_n ), refresh) -- %! Resize viewed windows to the correct size
|
||||||
|
|
||||||
|
@@ -6,4 +6,4 @@ borderWidth :: Dimension
|
|||||||
logHook :: X ()
|
logHook :: X ()
|
||||||
numlockMask :: KeyMask
|
numlockMask :: KeyMask
|
||||||
workspaces :: [WorkspaceId]
|
workspaces :: [WorkspaceId]
|
||||||
defaultLayouts, otherPossibleLayouts :: [SomeLayout Window]
|
possibleLayouts :: [SomeLayout Window]
|
||||||
|
2
Main.hs
2
Main.hs
@@ -53,10 +53,8 @@ main = do
|
|||||||
let winset | ("--resume" : s : _) <- args
|
let winset | ("--resume" : s : _) <- args
|
||||||
, [(x, "")] <- reads s = W.ensureTags defaultLayout workspaces x
|
, [(x, "")] <- reads s = W.ensureTags defaultLayout workspaces x
|
||||||
| otherwise = new defaultLayout workspaces $ zipWith SD xinesc gaps
|
| otherwise = new defaultLayout workspaces $ zipWith SD xinesc gaps
|
||||||
defaultLayout = SomeLayout $ LayoutSelection safeLayouts
|
|
||||||
gaps = take (length xinesc) $ defaultGaps ++ repeat (0,0,0,0)
|
gaps = take (length xinesc) $ defaultGaps ++ repeat (0,0,0,0)
|
||||||
|
|
||||||
safeLayouts = if null defaultLayouts then [SomeLayout Full] else defaultLayouts
|
|
||||||
cf = XConf
|
cf = XConf
|
||||||
{ display = dpy
|
{ display = dpy
|
||||||
, theRoot = rootw
|
, theRoot = rootw
|
||||||
|
@@ -20,7 +20,7 @@ module Operations where
|
|||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
import qualified StackSet as W
|
import qualified StackSet as W
|
||||||
import {-# SOURCE #-} Config (borderWidth,logHook,numlockMask,defaultLayouts,otherPossibleLayouts)
|
import {-# SOURCE #-} Config (borderWidth,logHook,numlockMask,possibleLayouts)
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.List (nub, (\\), find, partition)
|
import Data.List (nub, (\\), find, partition)
|
||||||
@@ -351,10 +351,10 @@ data ChangeLayout = NextLayout | PrevLayout | JumpToLayout String
|
|||||||
instance Message ChangeLayout
|
instance Message ChangeLayout
|
||||||
|
|
||||||
instance ReadableSomeLayout Window where
|
instance ReadableSomeLayout Window where
|
||||||
defaults = SomeLayout (LayoutSelection defaultLayouts) :
|
defaults = SomeLayout (LayoutSelection []) :
|
||||||
SomeLayout Full : SomeLayout (Tall 1 0.1 0.5) :
|
SomeLayout Full : SomeLayout (Tall 1 0.1 0.5) :
|
||||||
SomeLayout (Mirror $ Tall 1 0.1 0.5) :
|
SomeLayout (Mirror $ Tall 1 0.1 0.5) :
|
||||||
defaultLayouts ++ otherPossibleLayouts
|
possibleLayouts
|
||||||
|
|
||||||
data LayoutSelection a = LayoutSelection [SomeLayout a]
|
data LayoutSelection a = LayoutSelection [SomeLayout a]
|
||||||
deriving ( Show, Read )
|
deriving ( Show, Read )
|
||||||
|
Reference in New Issue
Block a user