taffybar-3.2.2: A desktop bar similar to xmobar, but with more GUI

Copyright | (c) José A. Romero L.
License | BSD3-style (see LICENSE)
Maintainer | José A. Romero L. <escherdragon@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | Safe
Language | Haskell2010

System.Taffybar.Information.StreamInfo

Description

Generic code to poll any of the many data files maintained by the kernel in POSIX systems. Provides methods for applying a custom parsing function to the contents of the file and to calculate differentials across one or more values provided via the file.

Synopsis

- getParsedInfo :: FilePath -> (String -> [(String, [a])]) -> String -> IO [a]
- getLoad :: (Integral a, RealFloat b) => b -> IO [a] -> IO [b]
- getAccLoad :: (Integral a, RealFloat b) => IORef [a] -> IO [a] -> IO [b]
- getTransfer :: (Integral a, RealFloat b) => b -> IO [a] -> IO [b]

# Documentation

getParsedInfo :: FilePath -> (String -> [(String, [a])]) -> String -> IO [a] Source #

Apply the given parser function to the file under the given path to produce a lookup map, then use the given selector as key to extract from it the desired value.

getLoad :: (Integral a, RealFloat b) => b -> IO [a] -> IO [b] Source #

Probe the given action and return the relative variation of each of the obtained values against the whole, where the whole is calculated as the sum of all the values in the probe.

getAccLoad :: (Integral a, RealFloat b) => IORef [a] -> IO [a] -> IO [b] Source #

Similar to getLoad, but execute the given action only once and use the given IORef to calculate the result and to save the current value, so it can be reused in the next call.

getTransfer :: (Integral a, RealFloat b) => b -> IO [a] -> IO [b] Source #

Probe the given action and, interpreting the result as a variation in time, return the speed of change of its values.