summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Perner <martin@perner.cc>2011-04-05 23:56:29 +0200
committerMartin Perner <martin@perner.cc>2011-04-05 23:56:29 +0200
commit63847f5b585e0fb5f19812ce9b5ddaa257b359b7 (patch)
treef3d03f08194943e557c70434933e80c33934dce2 /src
parent41fa766599e061dec240aced32b2444e631d6b60 (diff)
downloadxmobar-63847f5b585e0fb5f19812ce9b5ddaa257b359b7.tar.gz
xmobar-63847f5b585e0fb5f19812ce9b5ddaa257b359b7.tar.bz2
Bright Monitor: Use 0 if reading the file fails
Thx to mathstuf for the hint
Diffstat (limited to 'src')
-rw-r--r--src/Plugins/Monitors/Bright.hs2
1 files changed, 1 insertions, 1 deletions
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