
On Thu, Jun 14, 2007 at 09:21:44PM +0200, Robert Manea wrote:
Well, i did not want to do too much parsing and tokenizing. Though the idea is a good one, patches welcome :).
well, this is not a patch, but hope it will give you an Idea of what I have in mind. I've called it xmobar, but it's just a joke... I asked to myself, why doesn't Robert rewrite dzen2 in haskell? I'll be delighted to help. As I said I don't get C... dear haskellelers, do not start talking bad at me because the code is not so nice, etc. etc. I just wanted a code that was clear to read also for the novice (still I belong to this category) of hakell. I'm thinking to use it as a tutorial for the Xlib library (for the haskell wiki): as you know I'm far better at writing tutorials on difficult stuff than simple code. Who knows, perhaps someone is going to take the challenge and write an xmonad status bar... BTW, here's the usual ugly screen shot: http://gorgias.mine.nu/xmobar/xmobar.jpg here you'll fine more stuff (included binaries, hopefully working): http://gorgias.mine.nu/xmobar/ Attached you'll find xmobar.hs, the main file (compile with ghc --make xmobar.hs -o xmobar). Use like this: 1. from a terminal write: ./xmobar xmobar.config if you do not give a configuration file xmobar will use the default configuration. 2. After that nothing is going to happen. You need to type, something like: ^#ff0000Ciao ciao, my name is ^#00FF00Andrea! 3. Ok, you may now press enter. Something is supposed to happen. If it doesn't, well, that's better than you may think. In the screen shot I use it with mymon: ghc --make monitor.hs -o mymon monitor.hs is attached. I found it here, but I modified it: http://blog.csdn.net/danranx/archive/2007/06/10/1646608.aspx I've put, in my .xinitrc: while true ; do /path/to/mymon; sleep 5 ; done \ | /path/to/xmobar & do not forget the last & otherwise xmonad will not start, I think. Let me know if you like the bits. That would reinforce my ego. ;-) ciao andrea ps: I have the feeling that the parser actually sucks.