summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Batt.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-01-25 15:46:29 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-01-25 15:46:29 +0100
commit499ae3d7149c98e3c4d72dbd348094958cdebbc7 (patch)
tree3b371cd749ea9e2f0b5d9f6da9443aab5e0ac132 /src/Plugins/Monitors/Batt.hs
parentbec143183692b260bd02fc982952b31c672f2f29 (diff)
downloadxmobar-499ae3d7149c98e3c4d72dbd348094958cdebbc7.tar.gz
xmobar-499ae3d7149c98e3c4d72dbd348094958cdebbc7.tar.bz2
Battery: unnecessary external calls to /usr/bin/cat removed
Diffstat (limited to 'src/Plugins/Monitors/Batt.hs')
-rw-r--r--src/Plugins/Monitors/Batt.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs
index 0bb64d5..c9ea220 100644
--- a/src/Plugins/Monitors/Batt.hs
+++ b/src/Plugins/Monitors/Batt.hs
@@ -107,7 +107,7 @@ haveAc :: FilePath -> IO Bool
haveAc f = do
exists <- fileExist ofile
if exists
- then fmap ((== "1\n") . B.unpack) (catRead ofile)
+ then fmap ((== "1\n") . B.unpack) (B.readFile ofile)
else return False
where ofile = sysDir </> f
@@ -122,7 +122,7 @@ readBattery files =
(3600 * b / 1000000) -- wattseconds
(c / 1000000) -- volts
(d / c) -- amperes
- where grab = fmap (read . B.unpack) . catRead
+ where grab = fmap (read . B.unpack) . B.readFile
readBatteries :: BattOpts -> [Files] -> IO Result
readBatteries opts bfs =