import Xmobar import Config import Monitors import Music (mpris, gpmd) topProcL p = TopProc (p <~> ["-t" , " " , "-w", "10", "-L" , "10", "-H", "80"]) 15 diskIOL p = DiskIO [("/", ""), ("/home", "")] (diskArgs p) 10 mpd = MPD [ "-W", "12", "-b", "░", "-f", "▒", "-t", " "] 10 mpdt light = if light then "/ \ \</fc></fn> \ \<fn=0><album></fn> \ \<fn=0><fc=dodgerblue4><artist></fc> \ \<fc=burlywood4><composer></fc> <date></fn>" else "<ppos>/<plength> \ \<fn=0><title></fn> \ \<fn=0><fc=darkseagreen><album></fc></fn> \ \<fn=0><fc=darkseagreen4><artist></fc> \ \<fc=burlywood4><composer></fc> <date></fn>" autoMPD light = AutoMPD [ "-T", "110", "-E", "…", "-W", "10", "-t" , mpdt light] ompd light = MPD [ "-T", "120", "-W", "10", "-E", "…", "-t", tm, "--", "-p", "6669"] 20 where tm = " <remaining> " ++ mpdt light compMPD light = concatMonitor " " mpd (autoMPD light) mpn = "spotify" -- music light = toggleMonitor "/tmp/mpris.st" (mpris mpn 120) (compMPD light) -- music light = toggleMonitor "/tmp/mpris.st" gpmd (compMPD light) -- music light = toggleMonitor "/tmp/mpris.st" (compMPD light) (ompd light) music light = toggleMonitor "/tmp/mpris.st" (mpris mpn 120) (ompd light) -- music light = ompd light -- <fn=1> 💡 </fn> config p = (baseConfig p) { position = TopSize C 100 (defaultHeight - 1) , textOffset = defaultHeight - 8 , textOffsets = [defaultHeight - 9, defaultHeight - 9, defaultHeight - 6, defaultHeight - 8] , border = FullB , alpha = 255 , commands = [ Run (topProcL p) , Run m , Run (cpuBars p) , Run memory , Run (diskU p) , Run (diskIOL p) , Run brightness' , Run kbd -- , Run (batt p) , Run (wireless p "wlp1s0") , Run (dynNetwork p) , Run tun0 , Run (weather' "<skyConditionS> <tempC>° <weather>" "EGPH" p) -- LEGE, LEBL, KCV0 -- , Run (mail p) , Run masterVol , Run captureVol , Run laTime , Run localTime ] , template = " |EGPH| |bright|\ \ <action=`toggle-app.sh nm-applet`>|tun0||wlp1s0wi|</action> \ \ |dynnetwork| \ \ <action=`toggle-app.sh pasystray`>|default:Master|\ \ |default:Capture|</action> \ \ <action=`toggle-pipe.sh /tmp/mpris.st`>|" ++ alias m ++ "|</action> <fn=1>|kbd|</fn>{}\ \ |multicpu| |top| |memory|\ \ <fc=grey60>|diskio|</fc> |disku| \ \ <fn=2>🕓 </fn>|datetime| |laTime| " } where m = music (pIsLight p) main :: IO () main = palette >>= configFromArgs . config >>= xmobar