summaryrefslogtreecommitdiffhomepage
path: root/Plugins
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-05-30 16:08:44 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-05-30 16:08:44 +0200
commitc59b1b7191b06f2e2a6620f7a007128175cd72d6 (patch)
treecff297e60aeac297c97d05ed2953ec9d418183e3 /Plugins
parentdda166d42608f2170dd3af14a1a28e82941429fd (diff)
downloadxmobar-c59b1b7191b06f2e2a6620f7a007128175cd72d6.tar.gz
xmobar-c59b1b7191b06f2e2a6620f7a007128175cd72d6.tar.bz2
Wee refactoring.
Ignore-this: 975562d1d132fd88cfe4e91e6d86b3ee darcs-hash:20100530140844-1d908-a22bab70c71f658a2c5308b483a5b03b9035c0be.gz
Diffstat (limited to 'Plugins')
-rw-r--r--Plugins/Monitors/MPD.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Plugins/Monitors/MPD.hs b/Plugins/Monitors/MPD.hs
index 520279f..d2ffa15 100644
--- a/Plugins/Monitors/MPD.hs
+++ b/Plugins/Monitors/MPD.hs
@@ -57,17 +57,15 @@ parseMPD :: M.Response M.Status -> M.Response (Maybe M.Song) -> MOpts
-> (Float, [String])
parseMPD (Left e) _ _ = (0, show e:repeat "")
parseMPD (Right st) song opts =
- (b, [ss, si, vol, len, lap, remain, plen, pp] ++ sf)
+ (b, [ss, si, vol, len, lap, remain, plen, pp] ++ parseSong song)
where s = M.stState st
ss = show s
si = stateGlyph s opts
vol = int2str $ M.stVolume st
(p, t) = M.stTime st
- (lap, len) = (showTime p, showTime t)
- remain = showTime $ max 0 (t - p)
+ [lap, len, remain] = map showTime [p, t, max 0 (t - p)]
b = if t > 0 then fromIntegral p / fromIntegral t else 0
plen = int2str $ M.stPlaylistLength st
- sf = parseSong song
pp = case M.stSongPos st of
Nothing -> ""
Just (M.Pos n) -> int2str $ n + 1