From 63847f5b585e0fb5f19812ce9b5ddaa257b359b7 Mon Sep 17 00:00:00 2001 From: Martin Perner Date: Tue, 5 Apr 2011 23:56:29 +0200 Subject: Bright Monitor: Use 0 if reading the file fails Thx to mathstuf for the hint --- src/Plugins/Monitors/Bright.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugins/Monitors/Bright.hs b/src/Plugins/Monitors/Bright.hs index 4cbbfa4..499e5bc 100644 --- a/src/Plugins/Monitors/Bright.hs +++ b/src/Plugins/Monitors/Bright.hs @@ -101,7 +101,7 @@ readBright files = maxVal <- grab $ (fMax files) return $ (currVal / maxVal) where - grab = fmap (read . B.unpack) . B.readFile + grab f = catch (fmap (read . B.unpack) $ B.readFile f)(\_ -> return 0) showHorizontalBar :: Float -> Monitor String -- cgit v1.2.3