我xmobar
进入后马上就遇到一种奇怪的行为xmonad
。当我xmonad
(来自.xinitrc
,我使用XDM)xmobar
出现时,但它不在窗口堆栈的顶部或底部。一旦我启动了一个应用程序(例如,通过按Mod + Shift + Return
进入终端仿真器),该应用程序便会使用整个屏幕,就像xmobar
在底部一样。然后我按一下Mod + B
,什么也没有发生,一旦我Mod + B
第二次按下,xmobar
就抬到顶部,减小了应用程序窗口的大小。
之后,Mod + B
在剩余的xmonad
会话中可以正常使用,即降低/提高(隐藏/显示)会话xmobar
。
我相信我配置错误。我的xmonad.hs
样子:
import XMonad
import XMonad.Hooks.SetWMName
import XMonad.Hooks.DynamicLog
main = do
xmonad =<< statusBar "xmobar" myPP toggleStrutsKey defaultConfig
{ terminal = "urxvt"
, focusFollowsMouse = True
, clickJustFocuses = False
, borderWidth = 1
, modMask = mod4Mask
, workspaces = myworkspaces
, normalBorderColor = "#dddddd"
, focusedBorderColor = "#00dd00"
, manageHook = mymanager
, startupHook = setWMName "LG3D"
}
myPP = xmobarPP { ppOutput = putStrLn
, ppCurrent = xmobarColor "#336433" "" . wrap "[" "]"
--, ppHiddenNoWindows = xmobarColor "grey" ""
, ppTitle = xmobarColor "darkgreen" "" . shorten 20
, ppLayout = shorten 6
--, ppVisible = wrap "(" ")"
, ppUrgent = xmobarColor "red" "yellow"
}
toggleStrutsKey XConfig { XMonad.modMask = modMask } = (modMask, xK_b)
myworkspaces = [ "code"
, "web"
, "media"
, "irc"
, "random"
, "mail"
, "docs"
, "music"
, "root"
]
mymanager = composeAll
[ className =? "gimp" --> doFloat
, className =? "vlc" --> doFloat
]
虽然我的.xmobarrc
样子开始如下:
Config {
-- appearance
font = "xft:Bitstream Vera Sans Mono:size=9:bold:antialias=true"
, bgColor = "black"
, fgColor = "#646464"
, position = Top
, border = BottomB
, borderColor = "#646464"
-- layout
, sepChar = "%" -- delineator between plugin names and straight text
, alignSep = "}{" -- separator between left-right alignment
, template = "%battery% | %multicpu% | %coretemp% | %memory% | %dynnetwork% | %StdinReader% }{ %date% || %kbd% "
-- general behavior
, lowerOnStart = False -- send to bottom of window stack on start
, hideOnStart = False -- start with window unmapped (hidden)
, allDesktops = True -- show on all desktops
, overrideRedirect = True -- set the Override Redirect flag (Xlib)
, pickBroadest = False -- choose widest display (multi-monitor)
, persistent = True -- enable/disable hiding (True = disabled)
-- plugins (i do not use any)
, commands = [ -- actually several commands are in here
]
}
我尝试了以下几种组合:
, lowerOnStart =
, hideOnStart =
(正确/正确,正确/错误,错误/正确和错误/错误,如现在所示)。但是,我按Mod + B
两次之前的行为不会改变。我相信我没有xmonad
以某种方式配置错误,xmobar
但这只是一个猜测。
我.xinitrc
可能会有所帮助:
#!/bin/sh
if test -d /etc/X11/xinit/xinitrc.d
then
# /etc/X11/xinit/xinitrc.d is actually empty
for f in /etc/X11/xinit/xinitrc.d/*
do
[ -x "$f" ] && source "$f"
done
unset f
fi
# uk keyboard
setxkbmap gb
xrdb .Xresources
xscreensaver -no-splash &
# java behaves badly in non-reparenting window managers (e.g. xmonad)
export _JAVA_AWT_WM_NONREPARENTING=1
# set the background (again, because qiv uses a different buffer)
/usr/bin/feh --bg-scale --no-fehbg -z /usr/share/archlinux/wallpaper/a*.jpg
# pulse audio for alsa
then
/usr/bin/start-pulseaudio-x11
fi
exec xmonad
statusBar
并覆盖,handleEventHook = handleEventHook defaultConfig <+> docksEventHook
直到修复DynamicLog软件包为止。