jaor/xmobar — pull request #157 by mrak (2014-03-12 06:43:14+00:00)
Title: Verical Bar Template Variables

__Note: I'm only including code for Commons.hs in this initial PR. I plan to add `vbar` for all monitors using `bar` later (or in additon to this commit, if wanted)__

I'm implementing an additional `vbar` template variable for most monitors that support the usual `bar` template variable.

This code will be based on the `hbar` (it's actuall a vertical bar) code for the __Brightness__ monitor which uses unicode characters ▁▂▃▄▅▆▇█ (`chr` 9601-9608).

I currently use it on my machine for the __MultiCpu__ monitor to minimize textual space. The _Plugins/Monitors/Commons.hs_ code looks like this:

```haskell
showVerticalBar :: Float -> Monitor String
showVerticalBar x = colorizeString x [convert x]
where convert :: Float -> Char
convert val
| t <= 9600 = ' '
| t > 9608 = chr 9608
| otherwise = chr t
where t = 9600 + ((round val) `div` 12)
```

MultiCpu in my `.config/xmobar/xmobarrc` using `vbar0..` instead of `bar0..`:

```haskell
Run MultiCpu [ "-t", "「」"
, "-H", "80"
, "-h", "red"
] 10
...
template = " ... %multicpu% ... "
```