为了清楚起见,我的XMobar现在使用UnsafeStdinReader和SpawnPipe来发送有关工作区的信息。
main = do
xmprocleft <- spawnPipe "xmobar -x 0 $HOME/.config/xmobar/xmobarrc0.hs"
xmonad $ docks $ ewmhFullscreen $ ewmh $ def
{ manageHook = myManageHook <+> manageDocks
, modMask = myModMask
, terminal = myTerminal
, startupHook = myStartupHook
, layoutHook = showWName' myShowWNameTheme $ myLayoutHook
, workspaces = myWorkspaces
, borderWidth = myBorderWidth
, normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = \x -> hPutStrLn xmprocleft x
, ppCurrent = xmobarColor "#f8f16a" "" . wrap "<fn=1>" "</fn>" -- Workspace that I am viewing now
, ppVisible = xmobarColor "#98be65" "" . wrap "<fn=1>" "</fn>" . clickable -- Workspace that is open on any monitor other than this one
, ppHidden = xmobarColor "#2ac3de" "" . wrap "<fn=1>" "</fn>" . clickable -- Hidden workspaces that have any open software in it but not open on any monitors
, ppHiddenNoWindows = xmobarColor "#c0caf5" "" . wrap "<fn=1>" "</fn>" . clickable -- Workspaces with no open softwares and not open on any monitors
, ppTitle = xmobarColor "#c0caf5" "" . shorten 60 -- Title of active window
, ppSep = "<fc=#444b6a> | </fc>" -- Separator character
, ppUrgent = xmobarColor "#EBCB8B" "" . wrap "!<fn=1>" "</fn>!" -- Urgent workspace
, ppExtras = [windowCount] -- # of windows current workspace
-- name of workspaces, current layout, current title of open software, number of open windows in current workspace
, ppOrder = \(ws:_:_:_) -> [ws] -- stopped showing the current layout, number of open programs in current workspace
}
} `additionalKeysP` myKeys
"我想达到的目标"
根据XMonad Wiki,SpawnPipe在XMonadLog的新用途中被弃用,以将数据发送到XMobar。我正在尝试根据XMonad.Hooks.StatusBar.PP
和XMonad.Hooks.StatusBar
使用dynamicEasySBs
的动态状态栏。
我也对XMobar配置做了必要的修改。但是,配置对我来说有点混乱。有人用这种新格式做了一个工作配置吗?
1条答案
按热度按时间n53p2ov01#
在阅读新的Tutorial时,我设法更新了我的设置。
这就是您要编写
xmobarrc
的方式这应该是你的xmonad.hs
符合有关dinamicLog的文档
DynamicLog API被冻结,鼓励用户迁移到这些现代的替代品。
然后是XMonad.挂钩.状态栏
这个模块提供了一个可组合的接口,可以使用管道或X属性来启动或重新启动这些状态栏并记录到它们。还有XMonad.Hooks.StatusBar.PP,它提供了一个抽象和一些实用程序来定制记录到状态栏的内容。总之,这些是XMonad.Hooks.DynamicLog的现代替代品,它现在只是一个兼容性 Package 器。