Re: [dwm] on-the-fly tags creation and deletion

From: Julian Romero <julian.romero+dwm_AT_gmail.com>
Date: Mon, 21 Aug 2006 12:25:38 +0200

On 8/21/06, Sander van Dijk <a.h.vandijk_AT_gmail.com> wrote:
> This reusing of stdin for sending commands was suggested before (maybe
> by you, I don't remember, sorry), and I find it quite ugly. Stdin is
> for status-info, using it in this way for commands too is conceptually
> "not nice".
> It would be slightly better if you'd change it so that
> status displaying is a command too, so that only lines with the form
> (for instance) "status blabla" would be displayed (without the leading
> "status " of course).

Well, IMHO stdin may be no a good way to communicate with dwm...but
it's the only available so far. It was for status info...because there
isn't any other needs.
I'll make it more consistent. What I really wanted is: "tag: music
-dev -log" and "status: hello world" and even "view: editor1 editor2
editor7 im music" but requires some more time.

> Than at least things would be more consistent. I
> think it would still be too crude for dwm main though...

Yeah. Never pretended to go main. But without a run-time communication
mechanism dwm is quite static (for my needs, I mean) There should be a
way to talk with it, simple and small, without reaching wmii
complexity. Stdin? Piped files? Telnet? ...?

Don't take it very seriously, but an array of pipes will do the trick
typedef struct {
    const char *file;
    void (*func)(Arg *arg);
} Pipe;

Pipe pipeline[] = {
{ "-", modstatus},
}

Main dwm may define and use only the status pipe while some other user can have
Pipe pipeline[] = {
{ "-", modstatus},
{"~/.dwm/tagpipe, modtags},
{"~/.dwm/rulepipe, modrules},
}

Main dwm should provide the basic loop to open every pipe and call the
associated function when there is something to read.

> One aesthetic suggestion: get rid of the #define CMDLEN. It's an
> abstraction that's quite useless I believe (and it puts an unnecessary
> ...
> I think that would both look cleaner and make it easier to extend (add
> longer/shorter commands) in the future.

Thanks for the hint.

regards,

-- 
Julián
Received on Mon Aug 21 2006 - 12:25:40 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:30:15 UTC