monky-2.0.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 #

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 #

Class that output converters have to implement

Minimal complete definition

doLine

Methods

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

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

class PollModule a where #

The New class for collection modules

Minimal complete definition

getOutput

Methods

getOutput :: a -> IO [MonkyOut] #

Get the current (new) output

initialize :: a -> IO () #

Instances

PollModule BatteryH # 
PollModule NumaHandle # 
PollModule CPUHandle # 
PollModule TempHandle # 
PollModule FreqHandle # 
PollModule FTHandle # 
PollModule THandle # 
PollModule PostHandle # 
PollModule PrepHandle # 
PollModule Conn # 

Methods

getOutput :: Conn -> IO [MonkyOut] #

initialize :: Conn -> IO () #

PollModule FileHandle # 
PollModule AlsaH # 

Methods

getOutput :: AlsaH -> IO [MonkyOut] #

initialize :: AlsaH -> IO () #

PollModule NetworkStaticHandle # 
PollModule NetworkDynHandle # 
PollModule MBHandle # 
PollModule MHandle # 
PollModule WifiHandle # 
PollModule MonkyList # 
PollModule MPDHandle # 
PollModule IBusH # 

Methods

getOutput :: IBusH -> IO [MonkyOut] #

initialize :: IBusH -> IO () #

PollModule DiskH # 

Methods

getOutput :: DiskH -> IO [MonkyOut] #

initialize :: DiskH -> IO () #

(PollModule a, EvtModule b) => PollModule (PECombi a b) # 

Methods

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

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

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

Methods

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

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

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

Methods

getOutput :: CombiHandle a b -> IO [MonkyOut] #

initialize :: CombiHandle a b -> IO () #

class EvtModule a where #

The class for eventing modules

Minimal complete definition

startEvtLoop

Methods

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

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

Instances

EvtModule EvtPostHandle # 

Methods

startEvtLoop :: EvtPostHandle -> ([MonkyOut] -> IO ()) -> IO () #

EvtModule EvtPrepHandle # 

Methods

startEvtLoop :: EvtPrepHandle -> ([MonkyOut] -> IO ()) -> IO () #

EvtModule AlsaH # 

Methods

startEvtLoop :: AlsaH -> ([MonkyOut] -> IO ()) -> IO () #

EvtModule WifiHandle # 

Methods

startEvtLoop :: WifiHandle -> ([MonkyOut] -> IO ()) -> IO () #

EvtModule MonkyList # 

Methods

startEvtLoop :: MonkyList -> ([MonkyOut] -> IO ()) -> IO () #

EvtModule MPDHandle # 

Methods

startEvtLoop :: MPDHandle -> ([MonkyOut] -> IO ()) -> IO () #

EvtModule IBusH # 

Methods

startEvtLoop :: IBusH -> ([MonkyOut] -> IO ()) -> IO () #

(EvtModule a, EvtModule b) => EvtModule (EvtCombi a b) # 

Methods

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

data Modules #

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

data EvtModules #

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

Constructors

EvtModule a => DW a 

data PollModules #

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

Constructors

PollModule a => NMW a Int 

pollPack #

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