1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import Xmobar
import Config
topProc p = TopProc (p <~> ["-t" , "<mboth3> <mboth2> <mboth1> \
\· <both3> <both2> <both1>"
, "-w", "10", "-L" , "10", "-H", "80"]) 15
wireless p = Wireless "wlp2s0" (p <~> ["-t" , "<essid> <quality>"
, "-W", "5", "-M", "15" , "-m", "2"
, "-L", "20", "-H", "80"]) 20
multiCPU p = MultiCpu (p <~> ["-t", "<autototal>"
, "-S", "on", "-b", " ", "-f", "*"
, "-c", " " , "-L", "30", "-H", "70"
, "-p", "3", "-a", "l"]) 10
cpuFreq p = CpuFreq (p <~> ["-t" , "<cpu0> <cpu1> <cpu2> <cpu3>"
, "-L", "1", "-H", "2", "-S", "Off" , "-d", "2"]) 50
dynNetwork p = DynNetwork (p <~> ["-t", "↑ <tx> ↓ <rx>"
, "-L", "20", "-H", "1024000"
, "-m", "5", "-W", "10", "-S", "Off"]) 10
config p = (baseConfig p) {
position = TopSize C 100 defaultHeight
, textOffset = defaultHeight - 8
, border = BottomB
, commands = [ Run (topProc p)
, Run (wireless p)
, Run (multiCPU p)
, Run (cpuFreq p)
, Run (dynNetwork p)
, Run XMonadLog
, Run (Network "tun0" ["-t", "<dev>:", "-x", ""] 20)
, Run (DateZone "%H" "en_US" "US/Pacific" "laTime" 10)
, Run (Date "%R" "datetime" 10)
]
, template = " |top| {|XMonadLog|}\
\ |cpufreq| |multicpu| |dynnetwork|\
\ <action=`toggle-nm-applet.sh `>|tun0||wlp2s0wi|</action>\
\ |datetime| |laTime| "
}
main :: IO ()
main =
palette >>= configFromArgs . config >>= xmobar
|