From afb9cb1136abe9721ecd130e703358cbbcc14acc Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 10 Feb 2019 02:08:26 +0000 Subject: MPD and MPris moved into Music --- src/lib/Music.hs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/lib/Music.hs') diff --git a/src/lib/Music.hs b/src/lib/Music.hs index 480d419..eca8eb6 100644 --- a/src/lib/Music.hs +++ b/src/lib/Music.hs @@ -1,16 +1,38 @@ module Music where import Xmobar -import Mpris -import MPD import Monitors import qualified Bottom +import Config (defaultHeight) -compMPD = concatMonitor " " mpd autoMPD +mpris client = + Mpris2 client -- "clementine" -- + ["-t", " \ + \ <fc=sienna4><artist></fc>\ + \ <album> <length></fn>" + , "-T", "165", "-E", "...", "-M", "100", "-x", ""] 10 + +mprisConfig client p = Bottom.config [Run (mpris client)] "|mpris2|" p + +mpd = MPD [ "-W", "12", "-b", "░", "-f", "▒", "-t" + , " <lapsed> <fc=seashell3><fn=1><bar></fn></fc>"] 10 -alt x = altMonitor (Mpris.mpris x) compMPD +autoMPD = AutoMPD [ "-T", "150", "-E", "...", "-W", "10", "-t" + , "<length> <ppos>/<plength> \ + \<fn=0><fc=darkolivegreen><title></fc></fn> \ + \<fn=0><album></fn> \ + \<fn=0><fc=dodgerblue4><artist></fc> \ + \<fc=burlywood4><composer></fc> <date></fn>"] + +mpdConfig p = (Bottom.config [Run mpd, Run autoMPD] "|mpd| |autompd|" p) + { + textOffsets = [defaultHeight - 7, defaultHeight - 6] + } + +compMPD = concatMonitor " " mpd autoMPD +alt x = altMonitor (mpris x) compMPD config cl = if cl == "mpd" - then MPD.config + then mpdConfig else Bottom.config [Run (alt cl)] "|mpris2_mpd_autompd|" -- cgit v1.2.3