Re: [dwm] Stats script

From: Jake Todd <jaketodd422_AT_gmail.com>
Date: Sun, 3 May 2009 11:03:03 -0400

On Sun, 3 May 2009 09:38:36 +0200
"Claudio M. Alessi" <smoppy_AT_gmail.com> wrote:

> > The only problem with this is when memory goes over 100MB, it doesn't
> > show up (need to fix that).
> To be honest i don't get any value for the memory field at all. You should
> found a better "general" way. Alsa i suggest you, in order to save few (?)
> cycle of CPU, you can avoid to call cat(1) passing the file name directly
> to sed(1), tail(1), and so forth for others Unix tools.
>
> Hope this helps.
>
>
> Regards,
> Claudio M. Alessi

I took your advice and I've reduced the amount of cpu cycles used for
displaying stats by a significant amount. This is what my xinitrc looks like
now:

#!/bin/sh

xmodmap $HOME/.xmodmap
bgs media/pics/wallpapers/evisceration_plague_wallpaper2_1600x1200.jpg &
while true
    do
        xsetroot -name "`sed -e
        's/\ //g' /proc/acpi/thermal_zone/THRM/temperature | colrm 1 12` |
        `free -m | tail -2 | head -1 | colrm 1 27 | colrm 3`MB | `tail\
        -1 /proc/net/wireless | colrm 1 15 | colrm 3`% | `date '+%a %b %d %Y
        %T'`"
        sleep 1
done &
exec dwm
Received on Sun May 03 2009 - 15:03:03 UTC

This archive was generated by hypermail 2.2.0 : Sun May 03 2009 - 15:12:05 UTC