On Dec 6, 2008, at 10:20 AM, Guillaume Quintin wrote:

Why don't we change the way dwm gets its status text ? For example
we could use the SIGALRM signal to call a "spawn2" :

--snip--

This will take only a few LOC, because all the reading p[0] part
will be in fact the reading-stdin code from the run() function which
will not be needed anymore. This has the advantages that one can change
the status when dwm is running and there are no more "quitting"
problem. This is just an idea, forgive me not to propose some real
code. Well tell me what you think of this idea.

I'm not sure that changing the status script when dwm is running is a big advantage. I'm already used to recompiling if I want to change any setting. :)

The disadvantage of this approach is that the status script would have to do a lot of work to maintain any state. Most people run "date", "acpi" and other commands once a second, this would be fine for them.

My status text includes the weather (updated only every 15min to avoid hammering their servers), and the time (updated once a minute, on the minute, to reduce my wakeups-per-second in PowerTOP). For me, this SIGALRM and spawn2 would require that I store some temporary data somewhere between invocations.

Here's my status script in case anyone would be interested. It basically merges different status areas with arbitrary update intervals for each.

Attachment: status.lua
Description: Binary data

Reply via email to