summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2019-02-10 02:08:26 +0000
committerjao <jao@gnu.org>2019-02-10 02:08:26 +0000
commitafb9cb1136abe9721ecd130e703358cbbcc14acc (patch)
tree926db27a60caa315da20618e119587f8c9f0dc85 /src
parentc81ef7dad74a665b70612ded487a6b6128cbe081 (diff)
downloadxmobar-config-afb9cb1136abe9721ecd130e703358cbbcc14acc.tar.gz
xmobar-config-afb9cb1136abe9721ecd130e703358cbbcc14acc.tar.bz2
MPD and MPris moved into Music
Diffstat (limited to 'src')
-rw-r--r--src/lib/MPD.hs21
-rw-r--r--src/lib/Mpris.hs14
-rw-r--r--src/lib/Music.hs32
3 files changed, 27 insertions, 40 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|"