import Xmobar import Config import Monitors import Music (mpris, gpmd, mpdt) topProcL p = TopProc (p <~> ["-t" , " " ++ " · " , "-w", "12", "-L" , "10", "-H", "80"]) 15 diskIOL p = DiskIO [("/", ""), ("/home", "")] (diskArgs p) 10 mpd a p t = MPDX [ "-W", "12", "-b", "░", "-f", "▒", "-t", t, "--", "-p", p] 20 a autoMPD light = AutoMPD [ "-T", "110", "-E", "…", "-W", "10", "-t" , fc "grey40" (fni "\xf001") ++ " / /" -- ++ mpdt light ] pollMPD port light = MPD [ "-T", "120", "-W", "10", "-E", "…", "-t", tm, "--", "-p", port] 20 where tm = fc "grey40" (fni "\xf001") ++ " " -- ++ "/" -- ++ mpdt light mprisName = "spotifyd" musicPipe = PipeReader "/tmp/music" "musicpipe" musicMPRIS p = mpris p mprisName 180 -- music light = toggleMonitor "/tmp/mpris.st" musicPipe (pollMPD light) -- music p = toggleMonitor "/tmp/mpris.st" (pollMPD (pIsLight p)) (musicMPRIS p) -- music port = pollMPD port . pIsLight music = concatMonitor (fni " \xf1bc ") (mpd "mpd" "6600" "") (mpd "mopidy" "6669" "/ ") config p = (baseConfig p) { position = TopSize C 100 (defaultHeight - 1) , textOffset = defaultHeight - 8 , textOffsets = [defaultHeight - 9, defaultHeight - 9, defaultHeight - 6, defaultHeight - 8, -1, defaultHeight - 8] , border = FullB , alpha = 255 , commands = [ Run (topProcL p) , Run m , Run (thinkTemp p) , Run (NamedXPropertyLog "_EMACS_LOG" "elog") , Run (cpuBars p) , Run memory , Run (diskU p) , Run (diskIOL p) , Run brightness' , Run (kbd p) , Run (iconBatt p) , Run (wireless p "wlp1s0") , Run (dynNetwork p) , Run proton0 , Run (masterVol p) , Run captureVol , Run laTime , Run localTime -- , Run w -- LEGE, LEBL, KCV0 , Run (Com "curl" ["https://wttr.in?format=%c"] "wttr" 20000) , Run (Com "curl" ["https://wttr.in?format=%t+%C"] "wttrT" 20000) ] , template = " " ++ "|batt0| " ++ dimi "\xf26c" ++ " |bright| " ++ " |proton0||wlp1s0wi|" ++ " |dynnetwork| " ++ "" ++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|" ++ " " ++ ma -- ++ " |EGPH| " ++ fn 3 " |wttr| " ++ "|wttrT|" ++ " {} " ++ fc (pHigh p) "|elog|" ++ "|kbd| " ++ "|multicpu| " ++ "|multicoretemp| " ++ " |top| " ++ fni "\xf0c9" ++ " |memory| " ++ dimi "\xf1c0" ++ fc "grey60" " |diskio|" ++ " |disku| " ++ fni "\xf017" ++ " |datetime| " ++ "|laTime| " } where dimi = fc (pDim p) . fni m = music ma = dimi "\xf001" ++ " |" ++ alias m ++ "| " w = (weather' " ° " "EGPH" p) main :: IO () main = palette >>= configFromArgs . config >>= xmobar