summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEric Mrak <mail@ericmrak.info>2014-03-15 19:51:54 -0700
committerEric Mrak <mail@ericmrak.info>2014-03-15 19:51:54 -0700
commitd933e0adcca6d065836c91607f29c22941fd81f1 (patch)
tree9c7c511509aaa45cd16f7bd0624f1b4187d67302
parent2a43aae25b980bf08fd0b50c9517f9f72eb94f93 (diff)
downloadxmobar-d933e0adcca6d065836c91607f29c22941fd81f1.tar.gz
xmobar-d933e0adcca6d065836c91607f29c22941fd81f1.tar.bz2
MPD monitor has vbar for track progress
-rw-r--r--readme.md2
-rw-r--r--src/Plugins/Monitors/MPD.hs7
2 files changed, 5 insertions, 4 deletions
diff --git a/readme.md b/readme.md
index c532529..11c2c05 100644
--- a/readme.md
+++ b/readme.md
@@ -967,7 +967,7 @@ more than one battery.
The environment variables `MPD_HOST` and `MPD_PORT` are used to configure the
mpd server to communicate with.
- Variables that can be used with the `-t`/`--template` argument:
- `bar`, `state`, `statei`, `volume`, `length`,
+ `bar`, `vbar`, `state`, `statei`, `volume`, `length`,
`lapsed`, `remaining`,
`plength` (playlist length), `ppos` (playlist position),
`name`, `artist`, `composer`, `performer`,
diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs
index 1104608..ac976f2 100644
--- a/src/Plugins/Monitors/MPD.hs
+++ b/src/Plugins/Monitors/MPD.hs
@@ -22,7 +22,7 @@ import Control.Concurrent (threadDelay)
mpdConfig :: IO MConfig
mpdConfig = mkMConfig "MPD: <state>"
- [ "bar", "state", "statei", "volume", "length"
+ [ "bar", "vbar", "state", "statei", "volume", "length"
, "lapsed", "remaining", "plength", "ppos", "file"
, "name", "artist", "composer", "performer"
, "album", "title", "track", "genre"
@@ -82,11 +82,12 @@ mopts argv =
parseMPD :: M.Response M.Status -> M.Response (Maybe M.Song) -> MOpts
-> Monitor [String]
-parseMPD (Left e) _ _ = return $ show e:replicate 18 ""
+parseMPD (Left e) _ _ = return $ show e:replicate 19 ""
parseMPD (Right st) song opts = do
songData <- parseSong song
bar <- showPercentBar (100 * b) b
- return $ [bar, ss, si, vol, len, lap, remain, plen, ppos] ++ songData
+ vbar <- showVerticalBar (100 * b) b
+ return $ [bar, vbar, ss, si, vol, len, lap, remain, plen, ppos] ++ songData
where s = M.stState st
ss = show s
si = stateGlyph s opts