diff options
Diffstat (limited to 'src/Xmobar/Plugins')
-rw-r--r-- | src/Xmobar/Plugins/Monitors/MPD.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Xmobar/Plugins/Monitors/MPD.hs b/src/Xmobar/Plugins/Monitors/MPD.hs index 3bbae5d..c8c2dc9 100644 --- a/src/Xmobar/Plugins/Monitors/MPD.hs +++ b/src/Xmobar/Plugins/Monitors/MPD.hs @@ -101,13 +101,15 @@ parseMPD (Right st) song opts = do bar <- showPercentBar (100 * b) b vbar <- showVerticalBar (100 * b) b ipat <- showIconPattern (mLapsedIconPattern opts) b - return $ [bar, vbar, ipat, ss, si, vol, len, lap, remain, plen, ppos, flags] ++ songData + return $ [bar, vbar, ipat, ss, si, vol, len, lap, remain, plen, ppos, flags] + ++ songData where s = M.stState st ss = show s si = stateGlyph s opts vol = int2str $ fromMaybe 0 (M.stVolume st) (p, t) = fromMaybe (0, 0) (M.stTime st) - [lap, len, remain] = map showTime [floor p, floor t, max 0 (floor t - floor p)] + [lap, len, remain] = map showTime + [floor p, floor t, max 0 (floor t - floor p)] b = if t > 0 then realToFrac $ p / t else 0 plen = int2str $ M.stPlaylistLength st ppos = maybe "" (int2str . (+1)) $ M.stSongPos st |