如何使用xmonad生成这种平铺?
http://xmonad.org/images/screen-ejt-spiral-dzen.png
我知道您可以使用 mod-comma 增加/减少主窗格中的窗口数量,并使用 mod-space mod-h 和 mod-l 来更改布局。但似乎只是那些命令集无法在上面的链接中重现那种平铺。
特别是,有两件事我只是不知道如何处理上面的链接:
答案 0 :(得分:1)
您需要在.xmonad / xmonad.hs中创建一个新布局 为此,您需要对haskell有一点经验。
我创建了一个全屏布局,可以通过按下特定的组合键来使用,这是一个例子:
导入以下内容:
import XMonad.Layout.Spacing
import XMonad.Layout.LayoutCombinators hiding ( (|||) )
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.Reflect
import XMonad.Layout.Combo
import XMonad.Layout.TwoPane
import XMonad.Layout.Tabbed
import XMonad.Layout.PerWorkspace
import XMonad.Layout.IM
import XMonad.Layout.ThreeColumns
然后你可以这样做:
sPx = 1
verticalLayout = spacing sPx $ avoidStruts $ reflectHoriz $ Tall 1 0.03 0.5
verticalLayoutLargeScreen = spacing sPx $ avoidStruts $ ThreeCol 1 0.03 0.5
horizontalLayout = spacing sPx $ avoidStruts $ Mirror $ Tall 1 0.03 0.5
webdevLayout = spacing sPx $ avoidStruts $ Tall 1 0.03 0.63
fullscreenLayout = noBorders $ fullscreenFull $ Full
myLayout =
onWorkspace "2:web" (webdevLayout ||| fullscreenLayout) $
(verticalLayout ||| horizontalLayout ||| fullscreenLayout)
在此之后定义关键组合的映射:
myAdditionalKeys = [
-- Switch to next layout:
((mod4Mask .|. shiftMask, xK_m), sendMessage NextLayout),
]
然后不要忘记添加你的布局和你的键映射到配置,看起来像这样:
main = do
xmonad $ defaultConfig
{ manageHook = manageSpawn <+> myManageHook <+> manageDocks,
layoutHook = myLayout,
logHook = dynamicLogWithPP xmobarPP {
ppOutput = hPutStrLn xmproc,
ppLayout = (\ x -> ""),
ppTitle = xmobarColor "#b2ed00" ""
} >> updatePointer (Relative 0.99 0.99),
modMask = mod4Mask,
borderWidth = 4,
normalBorderColor = "#777777",
focusedBorderColor = "#ccff00",
workspaces = myWorkspaces,
focusFollowsMouse = True,
terminal = "x-terminal-emulator"
}
`removeKeys` myRemoveKeys
`additionalKeys` myAdditionalKeys