[dev] Accessory for dwm

From: Markus Wichmann <nullplan_AT_gmx.net>
Date: Sun, 20 Dec 2015 12:04:56 +0100

Hi all,

I have been using a small accessory application for dwm for a long time,
that I called dwmclock. What it did for the longest time was format the
load averages and the current time into a string, then set that as X11
root window name (dwm would thus display it in the bar window).

Today, I decided to change it into something more useful (I know the
flashplayer is stressing my CPU, so I don't need an application to tell
me). Also I thought utilization of the network is a more useful
information than utilization of my CPU, especially in this current time
of traffic shaping and other such nonsense.

Long story short, I wrote a dwmclock, that also displays the current
default interface's first letter (usually sufficient, as most people
have only at most one network card of each type in their machines), as
well as download and upload speeds. Currently it only works on linux,
though, as it reads the /proc and /sys interfaces (and that also means
it's subject to breakage on kernel upgrade. Sigh.)

As usual, criticisms and improvement suggestions are welcome. I already
know of one problem: I'm reading the interface statistics, which count
every received byte, even if it's from a broadcast message on a protocol
we don't care about or the like. I have no idea how to only count IP
traffic, however.

Also, I guess instead of my single second difference I should be using
something like a moving average, to smoothe out the curve. Oh well, food
for thought and later improvement.


Received on Sun Dec 20 2015 - 12:04:56 CET

This archive was generated by hypermail 2.3.0 : Sun Dec 20 2015 - 12:12:09 CET