I have some xmobarrc config
Config { lowerOnStart = False,
font = "xft:Terminus-12"
, bgColor = "#000000"
, fgColor = "#8080A1"
, position = Top
, commands = [ Run Network "eth0" ["-L","0","-H","32","--normal","#429942","--high","#A36666"] 10
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Date "/%a/ %_d.%m.%Y / %H:%M" "date" 10
, Run Com "sh" ["~/bin/weather.sh"] "weather" 60
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = " %StdinReader% }{ W:<fc=#fce94f>%weather%</fc> | %cpu% | %memory% | %eth0% | %date%"
}
And I have 2 questions:
- If I need a coloring
|
separator I should change all|
on<fc=#ffffff>|</fc>
, for example. So how can I use variableseparator = <fc=#ffffff>|</fc>
intemplate
? - Text, that
Network
andCpu
returning, always have a different length, so all stroke have different size all the time. How can I setNetwork
's text for fixed size?
For the first question: how to use
separator
in your template.Your template could be transformed to a list of strings, then you just use
intersperse separator
andconcat
:This expression yields:
If you're not used to Haskell, you can just put this whole expression of
let ... in ...
aftertemplate =
and it will work fine. Alternatively, you can put it at a top level:myTemplate = let temp = ... separator = ... in ...
and set the template code you have now to be: