[dwm] Done Before: dwm stat scripts!

From: T Biehn <tbiehn_AT_gmail.com>
Date: Sun, 30 Sep 2007 03:42:33 -0400

I spent a few hours cobbling this bad boy together (On a Flight and Elsewhere)
You'd need to tweak where it grabs battery life from or remove it
entirely, the part I really like is the connected network interfaces
script, which could be extended to display stuff like rx and tx bytes
(from wireless/) and other assorted statistics..

Anyone have any other things they put in here? Or perhaps better
script coding practices? (I'm just starting out)


urxvtd -q -o -f &
[ -f ~/.Xresources ] && xrdb .Xresources
[ -f ~/.fehbg ] && `< .fehbg` &
[ -p ~/.dwm-status ] || mkfifo ~/.dwm-status
dwm <> ~/.dwm-status &
while true;
  i: $(
  for name in /sys/class/net/*;
    [ `cat $name/operstate` == up ] && ([ -d $name/wireless ] &&\
     (echo $name | sed -re 's/.*\/([a-z0-9])/w.\1/') ||\
     (echo $name | sed -re 's/.*\/([a-z0-9])/\1/'));
  done )\
 `uptime | sed -re 's/ ([0-9]+:[0-9]+:[0-9]+).* ([0-9]+.[0-9]+,
[0-9]+.[0-9]+, [0-9]+.[0-9]+)/t: \1 l: \2/'`\
 `sed -nre 's/remaining.* ([0-9]+ mA).*/b: \1/p' <
> ~/.dwm-status
  sleep 60;

For those interested:

URxvt.font: -*-terminus-*-*-*-*-12-*-*-*-*-*-*-*,\
[codeset=JISX0208]xft:Kochi Gothic:antialias=false,\
URxvt.background: black
URxvt.foreground: white
URxvt.scrollstyle: plain
URxvt.scrollBar_right: true
URxvt.internalBorder: 1
URxvt.externalBorder: 0
URxvt.scollColor: #bb0000

groovy white on black on dark red dwm config:
#define NORMBORDERCOLOR "#222222"
#define NORMBGCOLOR "#222222"
#define NORMFGCOLOR "#eeeeee"
#define SELBORDERCOLOR "#bb0000"
#define SELBGCOLOR "#bb0000"
#define SELFGCOLOR "#222222"

The SELBORDERCOLOR being the same as SELBGCOLOR gives the 'bar' a more
integrated look with the 'active' window (given that it's at the top)
kind of looking like a tab.
Received on Sun Sep 30 2007 - 09:42:35 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:56:19 UTC