module Xmobar.Plugins.Monitors.CatInt where
import Xmobar.Plugins.Monitors.Common
catIntConfig :: IO MConfig
catIntConfig :: IO MConfig
catIntConfig = String -> [String] -> IO MConfig
mkMConfig String
"<v>" [String
"v"]
runCatInt :: FilePath -> [String] -> Monitor String
runCatInt :: String -> [String] -> Monitor String
runCatInt String
p [String]
_ =
let failureMessage :: String
failureMessage = String
"Cannot read: " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show String
p
fmt :: a -> String
fmt a
x = forall a. Show a => a -> String
show (forall a b. (RealFrac a, Integral b) => a -> b
truncate a
x :: Int)
in forall a.
(Ord a, Num a) =>
String
-> [[String]]
-> Maybe (String, String -> Int)
-> (Double -> a)
-> (a -> String)
-> Monitor String
checkedDataRetrieval String
failureMessage [[String
p]] forall a. Maybe a
Nothing forall a. a -> a
id forall {a}. RealFrac a => a -> String
fmt