diff options
| -rw-r--r-- | Main.hs | 2 | ||||
| -rw-r--r-- | Monitors/Net.hs | 2 | ||||
| -rw-r--r-- | Xmobar.hs | 13 | 
3 files changed, 8 insertions, 9 deletions
| @@ -37,7 +37,7 @@ main =         cl <- parseTemplate config (template config)         var <- execCommands config cl         (d,w) <- createWin config -       runXmobar config var d w eventLoop +       runXbar config var d w eventLoop  -- | Reads the configuration files or quits with an error  readConfig :: FilePath -> IO Config diff --git a/Monitors/Net.hs b/Monitors/Net.hs index f36c691..1f2343d 100644 --- a/Monitors/Net.hs +++ b/Monitors/Net.hs @@ -32,7 +32,7 @@ netConfig = mkMConfig      ["dev", "rx", "tx"]     -- available replacements --- takes to element of a list given their indexes +-- takes two elements of a list given their indexes  getTwoElementsAt :: Int -> Int -> [a] -> [a]  getTwoElementsAt x y xs =      z : [zz] @@ -16,7 +16,7 @@  module Xmobar (-- * Main Stuff                 -- $main                 Xbar -              , runXmobar +              , runXbar                , eventLoop                , createWin                -- * Printing @@ -53,7 +53,7 @@ import Runnable  --  -- The Xmobar data type and basic loops and functions. --- | This is just esthetics, stolen from XMonad: see 'runXmobar' +-- | This is copied from XMonad.  newtype Xbar a = X (ReaderT Config (StateT XState IO) a)      deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader Config) @@ -64,11 +64,10 @@ data XState =             , vars :: [(ThreadId, MVar String)]             } --- | Totally useless: but it is nice to be able to use get to get the --- state and ask to get the configuration: functions requires less --- arguments, after all. -runXmobar :: Config -> [(ThreadId, MVar String)] -> Display -> Window -> Xbar () -> IO () -runXmobar c v d w (X f) =  +-- | We use get to get the state and ask to get the configuration: whis way  +-- functions requires less arguments. +runXbar :: Config -> [(ThreadId, MVar String)] -> Display -> Window -> Xbar () -> IO () +runXbar c v d w (X f) =       do runStateT (runReaderT f c) (XState d w v)         return () | 
