XMobar 隐藏在第一个 XMonad 工作区
XMobar is hidden on first XMonad workspace
我使用配置的设置安装了 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>"
}
我对 xmobar v0.24 和 xmonad v0.12 也有同样的问题。我在快速重新编译两次 (meta-q) 时也遇到了所有工作区的问题。我通过在 .xmobarrc.
中将 overrideRedirect
设置为 False
来修复此问题
overrideRedirect
If you're running xmobar in a tiling window manager, you might need to set this option to False so that it behaves as a docked application. Defaults to True.
我使用配置的设置安装了 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>"
}
我对 xmobar v0.24 和 xmonad v0.12 也有同样的问题。我在快速重新编译两次 (meta-q) 时也遇到了所有工作区的问题。我通过在 .xmobarrc.
中将overrideRedirect
设置为 False
来修复此问题
overrideRedirect
If you're running xmobar in a tiling window manager, you might need to set this option to False so that it behaves as a docked application. Defaults to True.