summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--NEWS8
-rw-r--r--src/Plugins/Monitors/Batt.hs2
-rw-r--r--src/Plugins/Monitors/MPD.hs2
-rw-r--r--xmobar.cabal2
4 files changed, 11 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index e6e8a50..efc82e2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,14 @@
% xmobar - Release notes
% Jose A. Ortega Ruiz
+## Version 0.14
+
+_Bug fixes_
+
+ - [issue 50]: `MPD` monitor now works with libmpd 0.6.
+
+[issue 50]: http://code.google.com/p/xmobar/issues/detail?id=14
+
## Version 0.13 (March 28, 2011)
_New features_
diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs
index a472045..c276e6b 100644
--- a/src/Plugins/Monitors/Batt.hs
+++ b/src/Plugins/Monitors/Batt.hs
@@ -124,7 +124,7 @@ readBattery files =
(3600 * b / 1000000) -- wattseconds
(c / 1000000) -- volts
(if c > 0 then (d / c) else -1) -- amperes
- where grab = fmap (read . B.unpack) . B.readFile
+ where grab f = catch (fmap (read . B.unpack) $ B.readFile f) (\_ -> return 0)
readBatteries :: BattOpts -> [Files] -> IO Result
readBatteries opts bfs =
diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs
index 06d0fa7..60c3e48 100644
--- a/src/Plugins/Monitors/MPD.hs
+++ b/src/Plugins/Monitors/MPD.hs
@@ -91,7 +91,7 @@ parseSong (Right Nothing) = return $ repeat ""
parseSong (Right (Just s)) =
let join [] = ""
join (x:xs) = foldl (\a o -> a ++ ", " ++ o) x xs
- str sel = maybe "" join (M.sgGet sel s)
+ str sel = maybe "" join (M.sgGetTag sel s)
sels = [ M.Name, M.Artist, M.Composer, M.Performer
, M.Album, M.Title, M.Track, M.Genre ]
fields = M.sgFilePath s : map str sels
diff --git a/xmobar.cabal b/xmobar.cabal
index cc9e016..abdf136 100644
--- a/xmobar.cabal
+++ b/xmobar.cabal
@@ -112,7 +112,7 @@ executable xmobar
cpp-options: -DIWLIB
if flag(with_mpd) || flag(all_extensions)
- build-depends: libmpd >= 0.5
+ build-depends: libmpd >= 0.6
other-modules: Plugins.Monitors.MPD
cpp-options: -DLIBMPD