diff options
| -rw-r--r-- | src/lib/MPD.hs | 21 | ||||
| -rw-r--r-- | src/lib/Mpris.hs | 14 | ||||
| -rw-r--r-- | src/lib/Music.hs | 32 | ||||
| -rw-r--r-- | xmobar-config.cabal | 2 | 
4 files changed, 28 insertions, 41 deletions
| diff --git a/src/lib/MPD.hs b/src/lib/MPD.hs deleted file mode 100644 index 986ce0d..0000000 --- a/src/lib/MPD.hs +++ /dev/null @@ -1,21 +0,0 @@ -module MPD where - -import Xmobar -import Config (palette, defaultHeight) -import Monitors -import qualified Bottom (config) - -mpd = MPD [ "-W", "12", "-b", "░", "-f", "▒", "-t" -          , " <lapsed> <fc=seashell3><fn=1><bar></fn></fc>"] 10 - -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>"] - -config p = (Bottom.config [Run mpd, Run autoMPD] "|mpd| |autompd|" p) -  { -  textOffsets = [defaultHeight - 7, defaultHeight - 6] -  } diff --git a/src/lib/Mpris.hs b/src/lib/Mpris.hs deleted file mode 100644 index 171eee5..0000000 --- a/src/lib/Mpris.hs +++ /dev/null @@ -1,14 +0,0 @@ -module Mpris where - -import Xmobar -import Config (palette) -import qualified Bottom (config) - -mpris client = -  Mpris2 client -- "clementine" -- -         ["-t", " <fn=4><tracknumber>\ -                \ <title> <fc=sienna4><artist></fc>\ -                \ <album> <length></fn>" -         , "-T", "165", "-E", "...", "-M", "100", "-x", ""] 10 - -config client p = Bottom.config [Run (mpris client)] "|mpris2|" p 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", " <fn=0><tracknumber>\ +                \ <title> <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|" diff --git a/xmobar-config.cabal b/xmobar-config.cabal index 3ad80bf..9492938 100644 --- a/xmobar-config.cabal +++ b/xmobar-config.cabal @@ -15,7 +15,7 @@ library    hs-source-dirs: src/lib    exposed-modules: Config, Monitors, Bottom, Music    build-depends: base >=4.7 && <5, async > 2.2, stm >= 2.5, xmobar -  other-modules: Paths_xmobar_config, MPD, Mpris +  other-modules: Paths_xmobar_config    default-language: Haskell2010  executable xmobar-top | 
