import Xmobar.Screensaver
import Data.List
import Xmobar
import XMonad (getXMonadDir)
fgColor0 :: String
fgColor0 = "black"
fgColor1 :: String
fgColor1 = "#888888"
bgColor0 :: String
bgColor0 = "#eeeeee"
bdColor :: String
bdColor = "#cccccc"
wrapColor :: String -> String -> String
wrapColor c s = "" ++ s ++ ""
sep :: String
sep = wrapColor fgColor1 " : "
myTemplate :: String
myTemplate = formatTemplate left right
where
formatTemplate l r = intercalate sep l
++ " }{ "
++ intercalate sep r
++ " "
left = [ "%UnsafeStdinReader%" ]
right = [ "%wlp0s20f3wi%"
, "%alsa:default:Master%"
, "%battery%"
, "%bright%"
, "%screensaver%"
, "%locks%"
, "%date%"
]
config :: String -> Config
config confDir = defaultConfig {
font = "xft:DejaVu Sans Mono:size=11:bold:antialias=true"
, additionalFonts =
[ "xft:FontAwesome:pixelsize=13:antialias=true:hinting=true"
, "xft:Symbola:size=13:bold:antialias=true"
]
, textOffset = 16
, textOffsets = [ 16, 17 ]
, bgColor = bgColor0
, fgColor = fgColor0
, position = BottomSize C 100 24
, border = NoBorder
, borderColor = bdColor
, sepChar = "%"
, alignSep = "}{"
, template = myTemplate
, lowerOnStart = False
, hideOnStart = False
, allDesktops = True
, overrideRedirect = True
, pickBroadest = False
, persistent = True
, iconRoot = confDir ++ "/icons"
, commands =
[ Run $ Alsa "default" "Master"
[ "-t", "%"
, "--"
, "-O", "\xf028"
, "-o", "\xf026 "
, "-c", fgColor0
, "-C", fgColor0
]
, Run $ Battery [ "--template", ""
, "--Low", "10"
, "--High", "80"
, "--low", "red"
, "--normal", fgColor0
, "--high", fgColor0
, "--"
, "-P"
, "-o" , "\xf0e7"
, "-O" , "\xf1e6"
, "-i" , "\xf1e6"
] 50
, Run $ Brightness ["-t", "\xf185%"
, "--"
, "-D", "intel_backlight"
] 10
, Run $ Wireless "wlp0s20f3"
[ "-t", ""
, "--"
, "--quality-icon-pattern", ""
] 5
, Run $ Locks
[ "-N", "\x1f13d"
, "-n", wrapColor fgColor1 "\x1f13d"
, "-C", "\x1f132"
, "-c", wrapColor fgColor1 "\x1f132"
, "-s", ""
, "-S", ""
, "-d", " "
]
, Run $ Date "%Y-%m-%d %H:%M" "date" 10
, Run $ Screensaver ("\xf254", fgColor0, fgColor1) 10
, Run UnsafeStdinReader
]
}
main :: IO ()
main = do
confDir <- getXMonadDir
xmobar $ config confDir