monky-2.2.0.0: A system state collecting library and application

Maintainerongy, moepi
Stabilityexperimental
PortabilityLinux
Safe HaskellNone
LanguageHaskell2010

Monky.Modules

Description

The EvtModule and PollModule classes have to be implemented by monky compatible modules

Synopsis

Documentation

data MonkyOut Source #

A data type to encode general output types

Constructors

MonkyPlain Text

Plaintext output

MonkyBar Int

A Vertical bar, in %

MonkyHBar Int

A horizontal bar, in pixel Temporary (FG,BG) Color format (and somewhat image) are not fix yet, so don't rely on them to much

MonkyColor (Text, Text) MonkyOut

Colorize the enclosed output TODO: Color format

MonkyImage Text Char

Path to an image to display (for icons), or Unicode glyph that should be used

class MonkyOutput a where Source #

Class that output converters have to implement

Minimal complete definition

doLine

Methods

doLine :: a -> [[MonkyOut]] -> IO () Source #

Create one tick of output from a list of collection module output

class PollModule a where Source #

The New class for collection modules

Minimal complete definition

getOutput

Methods

getOutput :: a -> IO [MonkyOut] Source #

Get the current (new) output

initialize :: a -> IO () Source #

Instances

PollModule FTHandle Source # 
PollModule THandle Source # 
PollModule PostHandle Source # 
PollModule PrepHandle Source # 
PollModule WifiPollHandle Source # 
PollModule Conn Source # 
PollModule MonkyList Source # 
PollModule MPDHandle Source # 
PollModule NumaHandle Source # 
PollModule CPUHandle Source # 
PollModule TempHandle Source # 
PollModule FreqHandle Source # 
PollModule MBHandle Source # 
PollModule MFHandle Source # 
PollModule MHandle Source # 
PollModule NetworkStaticHandle Source # 
PollModule NetworkDynHandle Source # 
PollModule AlsaH Source # 
PollModule BatteryH Source # 
PollModule FileHandle Source # 
PollModule DiskH Source # 
PollModule a => PollModule (IOModifyHandle a) Source # 
PollModule a => PollModule (ModifyHandle a) Source # 
(PollModule a, EvtModule b) => PollModule (PECombi a b) Source # 

Methods

getOutput :: PECombi a b -> IO [MonkyOut] Source #

initialize :: PECombi a b -> IO () Source #

(EvtModule a, PollModule b) => PollModule (EPCombi a b) Source # 

Methods

getOutput :: EPCombi a b -> IO [MonkyOut] Source #

initialize :: EPCombi a b -> IO () Source #

(PollModule a, PollModule b) => PollModule (CombiHandle a b) Source # 

class EvtModule a where Source #

The class for eventing modules

Minimal complete definition

startEvtLoop

Methods

startEvtLoop :: a -> ([MonkyOut] -> IO ()) -> IO () Source #

Start your own event loop. The second argument is the consumer of your output.

Doing this in an opaque way gives a way to chain actions to your event handling

data Modules Source #

Wrapper around PollModules and EvtModules so we can pass all modules in one list to startLoop

data EvtModules Source #

A wrapper around EvtModule for so they can be in a list

Constructors

EvtModule a => DW a 

data PollModules Source #

A wrapper around module instances so they can be put into a list.

Constructors

PollModule a => NMW a Int 

pollPack Source #

Arguments

:: PollModule a 
=> Int

The refresh rate for this module

-> IO a

The function to get a module (get??Handle)

-> IO Modules

The packed module ready to be given to startLoop

Function to make packaging modules easier