Xmonad:如何重置主窗格中的窗口数量?
有时,当我在 Xmonad 中 mod-L
或 mod-H
时,我的窗口不会调整大小。我相信这是我不小心更改了主窗格中窗口数量的结果。有时我很幸运能够点击适量的 mod-,
或 mod-.
回到可以调整大小的位置,但并不经常。
如何将窗格重置为其默认值,即 Xmonad 在启动时为其提供的默认值?我的 xmonad.hs:
import XMonad
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import System.Exit
import Graphics.X11.Xlib
import IO (Handle, hPutStrLn)
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.SetWMName
import XMonad.Layout.IM
import XMonad.Layout.Reflect
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.PerWorkspace
import XMonad.Layout.LayoutHints
import XMonad.Layout.LayoutCombinators hiding ((|||))
import XMonad.Layout.LayoutHints
import XMonad.Layout.NoBorders
import XMonad.Layout.ComboP
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ResizableTile
import XMonad.Layout.Tabbed
import XMonad.Layout.TwoPane
import XMonad.Util.Run (spawnPipe)
import qualified XMonad.StackSet as W
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
main = do
h <- spawnPipe "/usr/bin/xmobar"
xmonad defaultConfig
{ workspaces = workspaces'
, borderWidth = borderWidth'
, logHook = logHook' h
, terminal = terminal'
, modMask = mod4Mask
, layoutHook = layoutHook'
, manageHook = manageHook'
, startupHook = setWMName "LG3D"
}
customPP :: PP
customPP = defaultPP { ppCurrent = xmobarColor "#AFAF87" "" . wrap "<" ">"
, ppTitle = shorten 80
, ppSep = "<fc=#AFAF87> | </fc>"
, ppHiddenNoWindows = xmobarColor "#AFAF87" ""
, ppUrgent = xmobarColor "#FFFFAF" "" . wrap "[" "]"
}
logHook' :: Handle -> X ()
logHook' h = dynamicLogWithPP $ customPP { ppOutput = hPutStrLn h }
manageHook' :: ManageHook
manageHook' = composeAll [
isFullscreen --> doFullFloat
]
layoutHook' = customLayout
borderWidth' :: Dimension
borderWidth' = 1
normalBorderColor', focusedBorderColor' :: String
normalBorderColor' = "#333333"
focusedBorderColor' = "#AFAF87"
workspaces' :: [WorkspaceId]
workspaces' = ["1", "2", "3", "4", "5", "6"]
customLayout = avoidStruts $ layoutHints $ smartBorders (Full ||| resizableTile ||| Mirror resizableTile)
where
resizableTile = ResizableTall nmaster delta ratio []
nmaster = 1
ratio = toRational (2/(1+sqrt(5)::Double))
delta = 3/100
terminal' :: String
terminal' = "urxvt"
我对这个文件的编辑太少了,以至于我几乎忘记了从手册页和 haddock 编译中费力挑选所收集到的有关 Xmonad API 的所有内容。是否有 Xmonad API 的优秀文档资源,但不是严格的参考工作?
It sometimes happens that when I mod-L
or mod-H
in Xmonad my windows don't resize. I believe this is a result of my having accidentally changed the number of windows in my master pane. Sometimes I'm lucky to hit just the right amount of mod-,
or mod-.
to get back to where I can resize, but not often.
How can I reset a pane to its default values, the ones which Xmonad gives it when starting? My xmonad.hs:
import XMonad
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import System.Exit
import Graphics.X11.Xlib
import IO (Handle, hPutStrLn)
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.SetWMName
import XMonad.Layout.IM
import XMonad.Layout.Reflect
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.PerWorkspace
import XMonad.Layout.LayoutHints
import XMonad.Layout.LayoutCombinators hiding ((|||))
import XMonad.Layout.LayoutHints
import XMonad.Layout.NoBorders
import XMonad.Layout.ComboP
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ResizableTile
import XMonad.Layout.Tabbed
import XMonad.Layout.TwoPane
import XMonad.Util.Run (spawnPipe)
import qualified XMonad.StackSet as W
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
main = do
h <- spawnPipe "/usr/bin/xmobar"
xmonad defaultConfig
{ workspaces = workspaces'
, borderWidth = borderWidth'
, logHook = logHook' h
, terminal = terminal'
, modMask = mod4Mask
, layoutHook = layoutHook'
, manageHook = manageHook'
, startupHook = setWMName "LG3D"
}
customPP :: PP
customPP = defaultPP { ppCurrent = xmobarColor "#AFAF87" "" . wrap "<" ">"
, ppTitle = shorten 80
, ppSep = "<fc=#AFAF87> | </fc>"
, ppHiddenNoWindows = xmobarColor "#AFAF87" ""
, ppUrgent = xmobarColor "#FFFFAF" "" . wrap "[" "]"
}
logHook' :: Handle -> X ()
logHook' h = dynamicLogWithPP $ customPP { ppOutput = hPutStrLn h }
manageHook' :: ManageHook
manageHook' = composeAll [
isFullscreen --> doFullFloat
]
layoutHook' = customLayout
borderWidth' :: Dimension
borderWidth' = 1
normalBorderColor', focusedBorderColor' :: String
normalBorderColor' = "#333333"
focusedBorderColor' = "#AFAF87"
workspaces' :: [WorkspaceId]
workspaces' = ["1", "2", "3", "4", "5", "6"]
customLayout = avoidStruts $ layoutHints $ smartBorders (Full ||| resizableTile ||| Mirror resizableTile)
where
resizableTile = ResizableTall nmaster delta ratio []
nmaster = 1
ratio = toRational (2/(1+sqrt(5)::Double))
delta = 3/100
terminal' :: String
terminal' = "urxvt"
I edit this file so little that I forget almost everything about Xmonad's API gleaned from laborious picking through the man-pages and haddock compilations between doing so. Is there a fine documentation resource for the Xmonad API that's not a strict reference work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,mod+shift+space 会重置您的布局。如果您不喜欢 mod- 和 mod-. 的行为,您可以使用
removeKeysP
从您的配置中删除它们:我不知道还有比文档中提供的更好的文档源xmonad.org 上的选项卡。
By default, mod+shift+space resets your layouts. If you don't like the behavior of mod-, and mod-., you can delete them from your config using
removeKeysP
:I don't know of a better documentation source than what's available on the documentation tab on xmonad.org.