diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-12 19:50:34 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-12 19:50:34 +0200 |
commit | e85b0920a06ad019754e1cb8e72eb6cc34cdeedc (patch) | |
tree | 34a28f6a54290bd7347f83efc4a7a5f387419f31 /xmobar.config-sample | |
parent | 14267de1e03841980ce99206c0cf63e40bfa6cca (diff) | |
download | xmobar-e85b0920a06ad019754e1cb8e72eb6cc34cdeedc.tar.gz xmobar-e85b0920a06ad019754e1cb8e72eb6cc34cdeedc.tar.bz2 |
use of existential types for plugin support
This patch, which *changes the configuration format*, adds easy plugin support
by using an existential type for storing the list of commands to be
executed. Adding a plugin is just a matter of writing the appropriate
instance of the Exec class, after importing Commands.hs.
I must thank Claus Reinke for the help in understanding the mysteries of
reading existential types. The Read instance of Runnable must be credited to
him. See here:
http://www.haskell.org/pipermail/haskell-cafe/2007-July/028227.html
darcs-hash:20070712175034-d6583-f10174bb3b0a9b4f6e08d05052c18f30e539b319.gz
Diffstat (limited to 'xmobar.config-sample')
-rw-r--r-- | xmobar.config-sample | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xmobar.config-sample b/xmobar.config-sample index e2d54a6..3092cbc 100644 --- a/xmobar.config-sample +++ b/xmobar.config-sample @@ -7,15 +7,15 @@ Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" , height = 15 , align = "right" , refresh = 10 - , commands = [ (Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"], 36000) - , (Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"], 10) - , (Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"], 10) - , (Cpu ["-L","3","-H","50","--normal","green","--high","red"], 10) - , (Exec "date" ["+\"%a %b %_d %H:%M\""] "mydate", 600) - , (Exec "date" ["+%Y"] "year", 304128000) - , (Memory ["-t","Mem: <usedratio>%"], 10) - , (Swap [], 10) - , (Exec "uname" ["-s","-r"] "", 36000) + , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 + , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 + , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 + , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 + , Run Com "date" ["+\"%a %b %_d %H:%M\""] "mydate" 600 + , Run Com "date" ["+%Y"] "year" 304128000 + , Run Memory ["-t","Mem: <usedratio>%"] 10 + , Run Swap [] 10 + , Run Com "uname" ["-s","-r"] "" 36000 ] , sepChar = "%" , template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% | %EGPF% | <fc=#ee9a00>%mydate% of %year%</fc> %uname%" |