summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/Monitors')
-rw-r--r--src/Plugins/Monitors/Batt.hs4
-rw-r--r--src/Plugins/Monitors/Common.hs5
2 files changed, 2 insertions, 7 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 =
diff --git a/src/Plugins/Monitors/Common.hs b/src/Plugins/Monitors/Common.hs
index cc1a6a7..27ab41c 100644
--- a/src/Plugins/Monitors/Common.hs
+++ b/src/Plugins/Monitors/Common.hs
@@ -53,7 +53,6 @@ module Plugins.Monitors.Common (
-- * Threaded Actions
-- $thread
, doActionTwiceWithDelay
- , catRead
) where
@@ -67,7 +66,6 @@ import Numeric
import Text.ParserCombinators.Parsec
import System.Console.GetOpt
import Control.Exception (SomeException,handle)
-import System.Process (readProcess)
import Plugins
-- $monitor
@@ -441,6 +439,3 @@ getData action var d =
do threadDelay d
s <- action
modifyMVar_ var (\_ -> return $! s)
-
-catRead :: FilePath -> IO B.ByteString
-catRead file = B.pack `fmap` readProcess "/bin/cat" [file] ""