import Xmobar import Config import Monitors import Music (mpris, gpmd, mpdt) memoratio = Memory ["-t","%", "-p", "2", "-W", "3"] 20 topProcL p = TopProc (p <~> ["-t" , memTemp ++ " · " , "-w", "12", "-L" , "10", "-H", "80"]) 15 where memTemp = if pIsLight p then " " else " " diskIOL p = DiskIO [("/", ""), ("/home", "")] (diskArgs p) 10 diskIOS p = DiskIO [("/", " ")] (diskArgs p) 10 mpd a p i = MPDX [ "-W", "12", "-b", "░", "-f", "▒", "-t", " " , "--", "-p", p, "-P", fni "\xf144", "-Z", fni i, "-S", fni i] 20 a mpdMon = mpd "mpd" "6600" "\xf001" mopMon = mpd "mopidy" "6669" "\xf1bc" mail' p = MailX [ ("J", "jao.inbox", pHigh p) , ("H", "jao.hacking", "") , ("b", "bigml.bugs", pHigh p) , ("B", "bigml.inbox", "") , ("S", "bigml.support", "") -- , ("W", "bigml.drivel", pLow p) -- , ("l", "bigml.lists", pLow p) -- , ("D", "jao.drivel", pLow p) -- , ("F", "feeds", pLow p) -- , ("E", "feeds.emacs", pLow p) -- , ("P", "feeds.prog", pLow p) -- , ("w", "feeds.words", pLow p) ] [ "-d", "~/var/mail" , "-s", " "] "mail" mail'' p = MailX [] [ "-d", "~/var/mail" , "-s", " "] "mail" config p = (baseConfig p) { position = TopSize C 100 (defaultHeight - 1) , textOffset = defaultHeight - 8 , textOffsets = [defaultHeight - 9, defaultHeight - 9, defaultHeight - 6, defaultHeight - 8, defaultHeight - 8, defaultHeight - 8] , alpha = 192 , border = FullB , commands = [ Run (topProcL p) , Run ((if isXmonad then mail' else mail'') p) , Run (iconBatt p) , Run mpdMon , Run (NamedXPropertyLog "_EMACS_LOG" "elog") , tray , if pIsLight p then Run (cpu p) else Run (cpuBars p) , Run memoratio , Run (diskU p) , Run (diskIOS p) , Run brightness , Run (kbd p) , Run (coreTemp p) , Run (wireless p "wlp164s0") , Run (dynNetwork p) , Run (vpnMark "wg-mullvad") , Run tun0 , Run (masterVol p) , Run captureVol , Run laTime , Run localTime , Run w -- LEGE, LEBL, KCV0 -- , Run (mpris p "playerctld" 20) ] , template = "|tray| " ++ " |batt0| " ++ dimi "\xf26c" ++ " |bright| " ++ "" ++ " |wg-mullvad||tun0||wlp164s0wi|" ++ "" ++ " |dynnetwork| " ++ "" ++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|" ++ " " ++ "|mpd|" -- ++ " |mpris2| " ++ " |EGPH| " ++ fc (pHigh p) "|elog|" ++ " {} " ++ "|kbd| " ++ "|mail| " ++ "|multicpu| " ++ "|multicoretemp| " ++ " |top| " ++ " " ++ fni "\xf0c9" ++ " |memory| " ++ " |diskio| |disku| " ++ " |datetime| " ++ "|laTime| " } where dimi = fc (pDim p) . fni w = weather' " ° " "EGPH" p isXmonad = pWm p == Just "xmonad" tray = if isXmonad then Run (NamedXPropertyLog "_XMONAD_TRAYPAD" "tray") else Run trayPadding main :: IO () main = palette >>= configFromArgs . config >>= xmobar