taffybar-3.2.2: A desktop bar similar to xmobar, but with more GUI
Copyright(c) José A. Romero L.
LicenseBSD3-style (see LICENSE)
MaintainerJosé A. Romero L. <escherdragon@gmail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

System.Taffybar.Information.Network

Description

Provides information about network traffic over selected interfaces, obtained from parsing the /proc/net/dev file using some of the facilities provided by the System.Taffybar.Information.StreamInfo module.

Synopsis

Documentation

getNetInfo :: String -> IO (Maybe [Int]) Source #

Returns a two-element list containing the current number of bytes received and transmitted via the given network interface (e.g. "wlan0"), according to the contents of the /proc/dev/net file.

parseDevNet' :: String -> [(String, [Int])] Source #

parseDevNet :: String -> [(String, (Int, Int))] Source #

getDeviceUpDown :: [String] -> Maybe (String, (Int, Int)) Source #

isInterfaceUp :: String -> MaybeT IO () Source #

handleFailure :: IO a -> MaybeT IO a Source #

data TxSample Source #

Constructors

TxSample 

Fields

Instances

Instances details
Eq TxSample Source # 
Instance details

Defined in System.Taffybar.Information.Network

Show TxSample Source # 
Instance details

Defined in System.Taffybar.Information.Network

Methods

showsPrec :: Int -> TxSample -> ShowS #

show :: TxSample -> String #

showList :: [TxSample] -> ShowS #

monitorNetworkInterfaces :: RealFrac a1 => a1 -> ([(String, (Rational, Rational))] -> IO ()) -> IO () Source #

updateSamples :: [(String, (TxSample, TxSample))] -> IO [(String, (TxSample, TxSample))] Source #

getSpeed :: TxSample -> TxSample -> (Rational, Rational) Source #

sumSpeeds :: [(Rational, Rational)] -> (Rational, Rational) Source #