monky-2.1.0.0: A system state collecting library and application

PortabilityLinux
Stabilityexperimental
Maintainerongy, moepi
Safe HaskellNone

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

Instances

Read MonkyOut 
Show MonkyOut 
Serialize MonkyOut 

class MonkyOutput a whereSource

Class that output converters have to implement

Methods

doLineSource

Arguments

:: a

The output handle, may have a connection handle

-> [[MonkyOut]]

The outputs generated by collection modules

-> IO ()

IO() since the output module chooses how to transfer the data to the display client

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

class PollModule a whereSource

The New class for collection modules

Methods

getOutputSource

Arguments

:: a

The handle, may store data from previous calls

-> IO [MonkyOut]

A list of outputs to build |Initialize the module, this is called once before data collection starts

Get the current (new) output

initializeSource

Arguments

:: a

The handle to initialize

-> IO () 

class EvtModule a whereSource

The class for eventing modules

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

forall a . EvtModule a => DW a 

data PollModules Source

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

Constructors

forall a . PollModule a => NMW a Int 

pollPackSource

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