diff options
| author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-11 20:31:31 +0200 | 
|---|---|---|
| committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-11 20:31:31 +0200 | 
| commit | 14267de1e03841980ce99206c0cf63e40bfa6cca (patch) | |
| tree | ed5c5fbcb499ad6fe9b8c1bfbbbd8ed6a5063c2c | |
| parent | 067f7992c48538661a68bb7814482bc18efc45dd (diff) | |
| download | xmobar-14267de1e03841980ce99206c0cf63e40bfa6cca.tar.gz xmobar-14267de1e03841980ce99206c0cf63e40bfa6cca.tar.bz2  | |
Commands.hs: monitors take only one action now
darcs-hash:20070711183131-d6583-785f3e62b8ef00537fa85ee94682d305cdfd008d.gz
| -rw-r--r-- | Commands.hs | 18 | 
1 files changed, 6 insertions, 12 deletions
diff --git a/Commands.hs b/Commands.hs index 8d39d30..7c0985e 100644 --- a/Commands.hs +++ b/Commands.hs @@ -54,18 +54,12 @@ class Exec e where      run :: e -> IO String  instance Exec Command where -    run (Weather s a) = do let af = return "No station ID specified" -                           runM (a ++ [s]) weatherConfig af runWeather  -    run (Network i a) = do let f = return "No device specified" -                           runM (a ++ [i]) netConfig f runNet -    run (Memory args) = do let af = runMem [] -                           runM args memConfig af runMem -    run (Swap args) = do let af = runSwap [] -                         runM args swapConfig af runSwap -    run (Cpu args) = do let af = runCpu [] -                        runM args cpuConfig af runCpu -    run (Battery args) = do let af = runBatt [] -                            runM args battConfig af runBatt +    run (Weather s a) = runM (a ++ [s]) weatherConfig runWeather  +    run (Network i a) = runM (a ++ [i]) netConfig runNet +    run (Memory args) = runM args memConfig runMem +    run (Swap args) = runM args swapConfig runSwap +    run (Cpu args) = runM args cpuConfig runCpu +    run (Battery args) = runM args battConfig runBatt      run (Exec prog args _) = do (i,o,e,p) <- runInteractiveCommand (prog ++ concat (map (' ':) args))                                  exit <- waitForProcess p                                  let closeHandles = do hClose o  | 
