module Blucontrol.Main (
  blucontrol
, ConfigControl (..)
) where

import Control.Monad.Trans.Control

import Blucontrol.Main.Control
import Blucontrol.Main.CLI
import Blucontrol.Control
import Blucontrol.Gamma
import Blucontrol.Recolor

blucontrol :: (ControlConstraint m (StM g (StM r ())), MonadControl m, MonadBaseControl IO g, MonadBaseControl IO r, MonadGamma g, MonadRecolor r)
           => ConfigControl m g r
           -> IO ()
blucontrol :: ConfigControl m g r -> IO ()
blucontrol ConfigControl m g r
c = do IO ()
launch
                  ConfigControl m g r -> forall a. m a -> IO a
forall (m :: * -> *) (g :: * -> *) (r :: * -> *).
ConfigControl m g r -> forall a. m a -> IO a
runControl ConfigControl m g r
c (m () -> IO ())
-> (ControlT m () -> m ()) -> ControlT m () -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ControlT m () -> m ()
forall (m :: * -> *) a. Monad m => ControlT m a -> m a
runControlT (ControlT m () -> IO ()) -> ControlT m () -> IO ()
forall a b. (a -> b) -> a -> b
$ (forall a. g a -> IO (StM g a))
-> (forall a. r a -> g (StM r a)) -> ControlT m ()
forall (m :: * -> *) (g :: * -> *) (r :: * -> *).
(ControlConstraint m (StM g (StM r ())), MonadBaseControl IO g,
 MonadBaseControl IO r, MonadControl m, MonadGamma g,
 MonadRecolor r) =>
(forall a. g a -> IO (StM g a))
-> (forall a. r a -> g (StM r a)) -> ControlT m ()
loopRecolor (ConfigControl m g r -> forall a. g a -> IO (StM g a)
forall (m :: * -> *) (g :: * -> *) (r :: * -> *).
ConfigControl m g r -> forall a. g a -> IO (StM g a)
runGamma ConfigControl m g r
c) (ConfigControl m g r -> forall a. r a -> g (StM r a)
forall (m :: * -> *) (g :: * -> *) (r :: * -> *).
ConfigControl m g r -> forall a. r a -> g (StM r a)
runRecolor ConfigControl m g r
c)