| Portability | Linux |
|---|---|
| Stability | experimental |
| Maintainer | ongy, moepi |
| Safe Haskell | None |
Monky.Modules
Description
The EvtModule and PollModule classes have to be implemented by monky compatible modules
- data MonkyOut
- = MonkyPlain Text
- | MonkyBar Int
- | MonkyHBar Int
- | MonkyColor (Text, Text) MonkyOut
- | MonkyImage Text Char
- class MonkyOutput a where
- class PollModule a where
- getOutput :: a -> IO [MonkyOut]
- initialize :: a -> IO ()
- class EvtModule a where
- startEvtLoop :: a -> ([MonkyOut] -> IO ()) -> IO ()
- data Modules
- = Poll PollModules
- | Evt EvtModules
- data EvtModules = forall a . EvtModule a => DW a
- data PollModules = forall a . PollModule a => NMW a Int
- pollPack :: PollModule a => Int -> IO a -> IO Modules
- evtPack :: EvtModule a => IO a -> IO Modules
Documentation
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 whereSource
Class that output converters have to implement
Methods
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
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
Arguments
| :: a | The handle to initialize |
| -> IO () |
Instances
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
Instances
| EvtModule EvtPostHandle | |
| EvtModule EvtPrepHandle | |
| EvtModule WifiHandle | |
| EvtModule MonkyList | |
| EvtModule AlsaH | |
| EvtModule a => EvtModule (IOModifyHandle a) | |
| EvtModule a => EvtModule (ModifyHandle a) | |
| (EvtModule a, EvtModule b) => EvtModule (EvtCombi a b) |
Wrapper around PollModules and EvtModules so we can pass all modules in one list to startLoop
Constructors
| Poll PollModules | |
| Evt EvtModules |
data EvtModules Source
A wrapper around EvtModule for so they can be in a list
data PollModules Source
A wrapper around module instances so they can be put into a list.
Constructors
| forall a . PollModule a => NMW a Int |
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 |
Function to make packaging modules easier