biskulopty
biskulopty

Reputation: 13

How to spawn XMobar instance for each screen?

This question has an appropriate answer, but it's hiding everything I found difficult inside "spawn xmobar" comment.
- How to spawn one instance of xmobar for different screens?
- If this is not an option, how to spawn multiple instances on multiple screens?
- How to setup logHook with multiple instances of xmobar?

Upvotes: 1

Views: 2209

Answers (1)

Daniel Wagner
Daniel Wagner

Reputation: 153172

e.g. something like this:

import XMonad
import XMonad.Util.Run
import XMonad.Layout.IndependentScreens

main = do
    n <- countScreens
    xmprocs <- mapM (\i -> spawnPipe $ "xmobar /home/biskulopty/.xmobarrc-" ++ show i ++ " -x " ++ show i) [0..n-1]
    xmonad def {
        logHook = {- use xmprocs, which is a list of pipes of type [Handle] -}
    }

Upvotes: 6

Related Questions