On Wed, Apr 04 2012, Uli Schlachter wrote: > people occasionally complain about awesome awesome.spawn() (and the wrappers > awful.util.spawn() and spawn_with_shell()). They want more control over the > argument array that is passed to the new process. They want to handle stdout > and > stderr individually. They want all of this to be non-blocking, so that their > WM > doesn't freeze. They want the child's exist code. > > And the coder heard their complaints. But he didn't want to write any code. So > he asked the almighty Google. Anyway, attached is a sample program which does > all of the above. This needs lua-ev[0] and luaposix[1]. lua-ev handles the > non-blocking part (and accidentally integrates with awesome's main loop) while > luaposix let's us set up pipes, fork and execute a process. > > Actually, I lied. To make lua-ev work with awesome, it needs a simple > patch[2]. > However, I hope that gets resolved eventually. > > So now that I mentioned this, let's see what cool stuff you come up with. > Actually, I write this mail mostly as a reminder to myself, but whatever. > > Cheers, > Uli > > P.S.: Yes, POSIX is not trivial, nor is libev. So what? :-P > > [0] https://github.com/brimworks/lua-ev > [1] https://github.com/rrthomas/luaposix > [2] > https://github.com/psychon/lua-ev/commit/7580fb759b8664f6598199eed4ac0c9d70c4352c
This is… awesome, Uli. I saw you did a pull requests, so eventually this will end into lua-ev. What would be cool is that we provide sugar based on your example in awesome 3.5. I've opened #985 to remind us of that. Thanks for this :) -- Julien
pgp4VuHe2dXge.pgp
Description: PGP signature