pakej-0.2.0.0: Status bar daemon

Safe HaskellNone
LanguageHaskell2010

Pakej

Contents

Description

Pakej - status bar daemon

Synopsis

The main function

pakej :: PakejWidget a -> IO () Source

Run Pakej with the provided Widget

pakejWith :: PakejConf -> PakejWidget a -> IO () Source

Run Pakej with the customized PakejConf and the provided Widget

Widget

type PakejWidget = Widget IO Text Text (WidgetConf Integer) Source

A highly monomorphic Widget type used by Pakej itself

data Widget m l v a b Source

Widget is an Automaton that operates over Monad m collecting results in the mapping l -> v

Instances

Monad m => Category * (Widget m l v) 
Monad m => Functor (Widget m l v a) 
Monad m => Applicative (Widget m l v a) 

(.) :: Category k cat => forall b c a. cat b c -> cat a b -> cat a c

morphism composition

id :: Category k cat => forall a. cat a a

the identity morphism

Store the result

data Access t Source

Public results are available everywhere, but the private ones are only available for local queries (meaning queries to the local UNIX socket Pakej's listening)

Constructors

Public 

Fields

unAccess :: !t
 
Private 

Fields

unAccess :: !t
 

Instances

Eq t => Eq (Access t) 
Show t => Show (Access t) 

public :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v Source

Store the Widget's result under the specified label publicly

private :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v Source

Store the Widget's result under the specified label privately

Combine the results

aggregate :: (Hashable l, Monad m) => [Widget m l v (WidgetConf n) Text] -> Widget m l v (WidgetConf n) Text Source

Aggregate all successful Widget's results

Failed Widget's results are skipped so they do not clutter the resulting value

Construct

text :: (Hashable l, MonadIO m, Integral n) => IO Text -> Widget m l v (WidgetConf n) Text Source

Construct a Widget from the IO action that returns Text

system :: (Hashable l, MonadIO m, Integral n) => IO (ExitCode, Text, Text) -> Widget m l v (WidgetConf n) Text Source

Construct a Widget from the external command.

constant :: (Hashable l, MonadIO m, Integral n) => IO b -> Widget m l v (WidgetConf n) b Source

Construct a Widget from the IO action

widget :: (Hashable l, MonadIO m, Integral n) => a -> (a -> IO a) -> Widget m l v (WidgetConf n) a Source

Construct a Widget from the iterating IO action

query :: HostName -> PortID -> Text -> PakejWidget Text Source

fromWire :: Monad n => (forall e m. Monad m => Wire (Timed NominalDiffTime ()) e m a b) -> Widget n l v a b Source

Get a widget from an abstract Wire

Configure

Pakej Configuration

data PortID :: *

Constructors

Service String 
PortNumber PortNumber 
UnixSocket String 

Instances

data Policy Source

Constructors

Replace 
Respect 

Instances

Widget Configuration

data WidgetConf n Source

Widget configuration

Instances

Eq n => Eq (WidgetConf n) 
Show n => Show (WidgetConf n) 

defaultWidgetConf :: Num n => WidgetConf n Source

The default Widget configuration

every :: (Hashable l, Monad m) => n -> Widget m l v (WidgetConf n) (WidgetConf n) Source

Wait n seconds between Widget updates

second :: Num a => a Source

1 second timeout

minute :: Num a => a Source

1 minute timeout

hour :: Num a => a Source

1 hour timeout

day :: Num a => a Source

1 day timeout

inbetween :: (Hashable l, Monad m) => Text -> Widget m l v (WidgetConf n) (WidgetConf n) Source

Separate Widgets values by some Text

netwire-4 helpers

mkFix :: Monoid s => (s -> a -> Either e b) -> Wire s e m a b Source

A port of netwire-4's mkFix

mkFixM :: (Monad m, Monoid s) => (s -> a -> m (Either e b)) -> Wire s e m a b Source

A port of netwire-4's mkFixM

mkState :: Monoid t => s -> (t -> (a, s) -> (Either e b, s)) -> Wire t e m a b Source

A port of netwire-4's mkState

mkStateM :: (Monad m, Monoid t) => s -> (t -> (a, s) -> m (Either e b, s)) -> Wire t e m a b Source

A port of netwire-4's mkStateM