Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pakej - status bar daemon
- pakej :: PakejWidget a -> IO ()
- pakejWith :: PakejConf -> PakejWidget a -> IO ()
- type PakejWidget = Widget IO Text Text (WidgetConf Integer)
- data Widget m l v a b
- (.) :: Category k cat => forall b c a. cat b c -> cat a b -> cat a c
- id :: Category k cat => forall a. cat a a
- data Access t
- public :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v
- private :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v
- aggregate :: (Hashable l, Monad m) => [Widget m l v (WidgetConf n) Text] -> Widget m l v (WidgetConf n) Text
- text :: (Hashable l, MonadIO m, Integral n) => IO Text -> Widget m l v (WidgetConf n) Text
- system :: (Hashable l, MonadIO m, Integral n) => IO (ExitCode, Text, Text) -> Widget m l v (WidgetConf n) Text
- constant :: (Hashable l, MonadIO m, Integral n) => IO b -> Widget m l v (WidgetConf n) b
- widget :: (Hashable l, MonadIO m, Integral n) => a -> (a -> IO a) -> Widget m l v (WidgetConf n) a
- query :: HostName -> PortID -> Text -> PakejWidget Text
- fromWire :: Monad n => (forall e m. Monad m => Wire (Timed NominalDiffTime ()) e m a b) -> Widget n l v a b
- data PakejConf
- defaultPakejConf :: PakejConf
- addrs :: Lens' PakejConf [PortID]
- data PortID :: *
- = Service String
- | PortNumber PortNumber
- | UnixSocket String
- policy :: Lens' PakejConf Policy
- data Policy
- data WidgetConf n
- defaultWidgetConf :: Num n => WidgetConf n
- every :: (Hashable l, Monad m) => n -> Widget m l v (WidgetConf n) (WidgetConf n)
- second :: Num a => a
- minute :: Num a => a
- hour :: Num a => a
- day :: Num a => a
- inbetween :: (Hashable l, Monad m) => Text -> Widget m l v (WidgetConf n) (WidgetConf n)
- mkFix :: Monoid s => (s -> a -> Either e b) -> Wire s e m a b
- mkFixM :: (Monad m, Monoid s) => (s -> a -> m (Either e b)) -> Wire s e m a b
- mkState :: Monoid t => s -> (t -> (a, s) -> (Either e b, s)) -> Wire t e m a b
- mkStateM :: (Monad m, Monoid t) => s -> (t -> (a, s) -> m (Either e b, s)) -> Wire t e m a b
The main function
pakej :: PakejWidget a -> IO () Source
Run Pakej with the provided Widget
pakejWith :: PakejConf -> PakejWidget a -> IO () Source
Widget
type PakejWidget = Widget IO Text Text (WidgetConf Integer) Source
A highly monomorphic Widget
type used by Pakej itself
Widget is an Automaton that operates over Monad
m
collecting
results in the mapping l -> v
Store the result
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)
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
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
Widget Configuration
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
inbetween :: (Hashable l, Monad m) => Text -> Widget m l v (WidgetConf n) (WidgetConf n) Source
Separate Widget
s values by some Text
netwire-4 helpers
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