[xmonad] XMoBar Question
Hans Philipp Annen
hpa at gmx.li
Wed Dec 12 19:19:58 EST 2007
Hi!
On Thu, Dec 13, 2007 at 12:14:03AM +0100, Dominik Bruhn wrote:
> Hy,
> I tried to switch from dzen2 to xmobar as statusbar for my xmonad but
> ran into these three problems:
>
> 1. I want my Mailcount (how many new mails are there in my Maildir on my
> harddisk) to be displayed. How can I achieve this? Should I run a
> external program? Im searching for a solution which needs the less cpu
> (and io) as possible, as xmonad is running on my notebook. An external
> shellscript would do a big overhead, so is there a better solution?
Well, I think a shell script is ok if you don't need to check your email
account every few seconds...
I use the following quick-and-dirty script for my Maildir: It shows "M 0"
in white if there are no new mails, "M 4" (4 being the total number of new
mails) if there is at least one new mail in the INBOX and the whole thing
in green if there is new mail but nothing in the inbox (just new mails in
subfolders for mailing lists or spam):
#!/bin/sh
nnewmail=`find $MAILDIR/ -wholename "*new/*" |wc -l`
nnewinterestingmail=`ls $MAILDIR/new`
#for xmobar
if [[ $nnewmail == 0 ]]; then
echo "M 0"
elif [[ $nnewinterestingmail != "" ]]; then
echo "<fc=#FF3030>M $nnewmail</fc>"
else
echo "<fc=#00FF00>M $nnewmail</fc>"
fi
I execute it every 3 minutes, so the overhead is not that big
As for the battery status and icons: I think xmobar is strictly
text-based, but I wrote a small C Program to generate a battery status
bar like this:
charing [########-----]
It's just a few lines, if you are interested I will send them to you.
Hans Philipp Annen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20071213/ebc64b45/attachment.bin
More information about the xmonad
mailing list