Window-Manager

XMonad 沒有啟動 xmobar

  • July 21, 2014

出於某種原因,我的 xmonad 配置不會啟動 xmobar,但它不會引發任何錯誤,並且該命令xmobar可以正常啟動它。這是我的xmobar.hs

import XMonad
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
import XMonad.Util.Run(spawnPipe)

main = do
    xmproc <- spawnPipe "xmobar"
    xmonad $ defaultConfig
        { terminal    = "terminator"
        , layoutHook = avoidStruts $ layoutHook defaultConfig
        , manageHook=manageHook defaultConfig <+> manageDocks
        , logHook = dynamicLogWithPP $ sjanssenPP { ppOrder = reverse }
        , borderWidth = 1
        }

它會立即關閉,因為您沒有向其發送任何內容。您需要指定漂亮列印的輸出:

   dynamicLogWithPP $ sjanssenPP {ppOutput = hPutStrLn xmproc},

引用自:https://unix.stackexchange.com/questions/145786