diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-17 11:14:38 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-17 11:14:38 +0200 |
commit | c2b98fd88acba773135167454422ff68c85e2f49 (patch) | |
tree | b34ebf398db597872cbc8f41ee04c13c9e32cacd | |
parent | 6d21a15b2563c8e6f84e1a6fbc6f6b6eb3439cd0 (diff) | |
download | xmobar-c2b98fd88acba773135167454422ff68c85e2f49.tar.gz xmobar-c2b98fd88acba773135167454422ff68c85e2f49.tar.bz2 |
changed runXmobar to runXbar
darcs-hash:20070717091438-d6583-cd772f86e2296bf7de4780425819d3d04d502a6e.gz
-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 () |