On Fri, Mar 24 2017, Alex Efros <[email protected]> wrote:

> Hi!
>
> I've both autorun of about 20 urxvt on X start and auto-respawn for them:
> when any of these windows closes bash script (.fluxbox/startup) which
> auto-started them get SIGCHLD and restart corresponding urxvt (right now
> it store PIDs of all urxvt and use `kill -0` to check all of them on each
> SIGCHLD and restart missing ones).
>
> Switching to urxvtd/urxvtc looks interesting (20 urxvt!), but how I can
> implement auto-restart of closed windows? Now there are no PIDs.
>
> Is it possible to implement some sort of signaling as perl extension for
> urxvtd which will notify something on each window close? Or maybe there
> are simpler solutions exists?

How about a perl (or python, if you prefer) (basic sh (don't know about
bash/zsh) does not handle this as 'wait' there waits until all processes
exit)...
... program which launches those terminals, saves their pids and then
loops in wait() -- and restarts the exited processes, based on the pid
wait() returns? 
 
Tomi

>
>
> It should be possible to implement polling: every 1 second get list of all
> existing windows, check their names (I run each urxvt with unique -name),
> and if some names are missing then start `urxvtc -name $MISSINGNAME`.
> But I don't really like polling - it will eat system resources and add
> extra delay before restarting terminal window.
>
> -- 
>                       WBR, Alex.

_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/rxvt-unicode

Reply via email to