diff options
author | Martin Perner <martin@perner.cc> | 2011-04-05 23:56:29 +0200 |
---|---|---|
committer | Martin Perner <martin@perner.cc> | 2011-04-05 23:56:29 +0200 |
commit | 63847f5b585e0fb5f19812ce9b5ddaa257b359b7 (patch) | |
tree | f3d03f08194943e557c70434933e80c33934dce2 /src/Plugins/Monitors/Bright.hs | |
parent | 41fa766599e061dec240aced32b2444e631d6b60 (diff) | |
download | xmobar-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/Plugins/Monitors/Bright.hs')
-rw-r--r-- | src/Plugins/Monitors/Bright.hs | 2 |
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 |