我安装了XMonad和XMobar,并进行了配置。当我启动XMonad并在任何非第一个工作区打开XMobar时,已打开的程序将位于XMobar下方。但是,在第一个工作区打开任何程序时,XMobar会隐藏起来。
以下是我的XMonad和XMobar配置:
--XMonad:
import XMonad
import XMonad.Util.Run(spawnPipe)
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
main = do
xmproc <- spawnPipe "xmobar ~/.xmobarrc"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, borderWidth = 2
, terminal = "terminator"
, normalBorderColor = "#cccccc"
, focusedBorderColor = "#cd8b00"
}
--XMobar:
Config { font = "-misc-fixed-*-*-*-*-33-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, commands = [ Run Cpu ["-L","3","-H","50",
"--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Com "uname" ["-s","-r"] "" 36000
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, Run Com "~/.xmonad/batt" [] "" 300
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %memory% | %.xmonad/batt% | <fc=#ee9a00>%date%</fc>"
}