diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-03 13:06:09 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-03 13:06:09 +0200 |
commit | c86bc6bf7704740c357e5a30ce8c2eee114d5b38 (patch) | |
tree | 2be4ef67517f0db3d7db08ee4010397162f126da /Commands.hs | |
parent | 43e01ea9eee814d3984ebec9507cf5439caef149 (diff) | |
download | xmobar-c86bc6bf7704740c357e5a30ce8c2eee114d5b38.tar.gz xmobar-c86bc6bf7704740c357e5a30ce8c2eee114d5b38.tar.bz2 |
reintroduced run as an Exec method: this way it is possible to write plugins by defining either run or start
darcs-hash:20071003110609-d6583-68205f8664c81ff7e3349ee67d32ffd4f91881b1.gz
Diffstat (limited to 'Commands.hs')
-rw-r--r-- | Commands.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Commands.hs b/Commands.hs index 9c6df7a..eaa0db1 100644 --- a/Commands.hs +++ b/Commands.hs @@ -28,7 +28,13 @@ import System.IO (hClose, hGetLine) class Show e => Exec e where alias :: e -> String alias e = takeWhile (not . isSpace) $ show e + run :: e -> IO String + run _ = return "" start :: e -> (String -> IO ()) -> IO () + start e cb = go + where go = do + run e >>= cb + tenthSeconds 10 >> go data Command = Com Program Args Alias Rate deriving (Show,Read,Eq) |