
Hi, I hope i'm not off-topic. I'm posting here because i haven't been able to contact Andrea, xmobar's maintainer, and i thought some of you might be interested in a couple of add-ons to xmobar that i've been hacking on: - two new monitors, MultiCpu and Disk, providing cpu usage for multicores and disk I/O speeds, respectively. - new options to all monitors to set maximum/minimum field widths and padding characters. The code is available in this darcs repo: http://darcs.hacks-galore.org/jao/xmobar which you can also browse on-line at http://darcs.hacks-galore.org/darcsweb/jao?r=xmobar;a=summary The additions are documented in the README file. Since this is my first Haskell hacking beyond tutorial snippets, i'm sure the code can be improved, so feel free to criticise it as deserved, or to ask for other improvements. Thanks! jao -- Humans think they are smarter than dolphins because we build cars and buildings and start wars etc., and all that dolphins do is swim in the water, eat fish and play around. Dolphins believe that they are smarter for exactly the same reasons. -Douglas Adams

On 10-01-28 15:48, Jose A. Ortega Ruiz wrote:
- two new monitors, MultiCpu and Disk, providing cpu usage for multicores and disk I/O speeds, respectively. - new options to all monitors to set maximum/minimum field widths and padding characters.
Thank you for these improvements, they are definitly useful. I use MultiCpu with the new -p option for a 4-cores CPU, and it works perfectly. I hope it gets integrated in the official repository :)
The additions are documented in the README file. Since this is my first Haskell hacking beyond tutorial snippets, i'm sure the code can be improved, so feel free to criticise it as deserved, or to ask for other improvements.
Well I don't know if it's really important, but if .xmobarrc starts with an empty line, I get the following error message: xmobar: /home/galdor/.xmobarrc: configuration file contains errors at: "Config" (line 1, column 1): unexpected "\n" expecting "Config" Removing the empty line is a solution, but I wonder why the parser fails here. Regards, -- Nicolas Martyanoff http://codemore.org khaelin@gmail.com

* On Thursday, January 28 2010, Nicolas Martyanoff wrote:
On 10-01-28 15:48, Jose A. Ortega Ruiz wrote: ...
Well I don't know if it's really important, but if .xmobarrc starts with an empty line, I get the following error message:
xmobar: /home/galdor/.xmobarrc: configuration file contains errors at: "Config" (line 1, column 1): unexpected "\n" expecting "Config"
Removing the empty line is a solution, but I wonder why the parser fails here.
Hi Jose, That error happens because the parser isn't told to drop leading spaces. Attached is a patch that lets it ignore any leading space. -- Adam

Adam Vogt
Hi Jose,
That error happens because the parser isn't told to drop leading spaces.
Attached is a patch that lets it ignore any leading space.
Thanks a lot, Adam. I've updated my repo, applying your patch by hand (i couldn't do a darcs apply because i read the list through gmane, and it rewrites *all* email addresses :) -- i hope that's OK) Cheers, jao -- "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"

Quoting "Jose A. Ortega Ruiz"
I hope i'm not off-topic. I'm posting here because i haven't been able to contact Andrea, xmobar's maintainer, and i thought some of you might be interested in a couple of add-ons to xmobar that i've been hacking
Here are some short hacks of my own, along with the descriptions I sent to Andrea. ~d 1. parsing Haskell-style escapes in the config Since StdinReader gets expanded before xmobar looks for alignment separators, you have to choose the alignment separators carefully to be characters that will never appear on stdin. Since I wanted to send window titles via stdin, this doesn't leave many safe options! The best I could come up with was the null character (ASCII 0, the string-ender in C). But xmobar's config parser wouldn't parse "\NUL" or "\0". Here's a patch that makes it do so, and at the same time cuts out a bunch of code; it shouldn't break any old configs unless they relied on "\n" being converted to "n" (instead of a newline) or something similar. 2. XPosition constructors with a height parameter Here's a patch that adds two XPosition constructor. They are TopSize Align Int Int BottomSize Align Int Int The meaning of the first is much like TopW, except that it adds a parameter for a minimum height (in pixels). (BottomW is similar.) I like this because it makes it possible to mesh xmobar with my dock -- making them both the same height -- even if the font isn't big enough to fill the height of the dock. I also added a blurb about it in the README. I tried to use the syntax of the rest of the file, but you should probably check that it still "compiles" (or whatever) correctly. I didn't know how to check this myself, sorry.

wagnerdm@seas.upenn.edu writes: [...]
Here are some short hacks of my own, along with the descriptions I sent to Andrea. ~d
They seem to work nicely here: i've put them in my darcs repo. Thanks! Cheers, jao -- Purely applicative languages are poorly applicable. - Alan Perlis, Epigrams in Programing

"Jose A. Ortega Ruiz"
The code is available in this darcs repo:
http://darcs.hacks-galore.org/jao/xmobar
which you can also browse on-line at
http://darcs.hacks-galore.org/darcsweb/jao?r=xmobar;a=summary
I've just added a couple more monitors: MBox, a mail monitor for mbox files (need hinotify), and DiskU, a disk usage monitor. The latter uses and FFI binding, and there was some trickery involved in making it work on 64bit systems: if you try it on such a system, i'd be glad to hear of that. Thanks! jao -- Computers are useless. They can only give you answers. - Pablo Picasso

On Thu, Jan 28, 2010 at 03:48:11PM +0100, Jose A. Ortega Ruiz wrote:
Hi,
I hope i'm not off-topic. I'm posting here because i haven't been able to contact Andrea, xmobar's maintainer, and i thought some of you might be interested in a couple of add-ons to xmobar that i've been hacking on:
- two new monitors, MultiCpu and Disk, providing cpu usage for multicores and disk I/O speeds, respectively. - new options to all monitors to set maximum/minimum field widths and padding characters.
The code is available in this darcs repo:
http://darcs.hacks-galore.org/jao/xmobar
which you can also browse on-line at
http://darcs.hacks-galore.org/darcsweb/jao?r=xmobar;a=summary
The additions are documented in the README file. Since this is my first Haskell hacking beyond tutorial snippets, i'm sure the code can be improved, so feel free to criticise it as deserved, or to ask for other improvements.
Thanks! jao
I have commit access to xmobar, feel free to 'darcs send' me any patches you might have. If you plan to do lots of xmobar hacking let me know and I can grant you access as well. Cheers, Spencer Janssen
participants (5)
-
Adam Vogt
-
Jose A. Ortega Ruiz
-
Nicolas Martyanoff
-
Spencer Janssen
-
wagnerdm@seas.upenn.edu