<p dir="ltr"><br>
On Mar 22, 2014 1:15 AM, "Matthew Cengia" <<a href="mailto:mattcen@gmail.com">mattcen@gmail.com</a>> wrote:<br>
><br>
> On 2014-03-22 01:01, Jason A. Donenfeld wrote:<br>
> [...]<br>
> > By the way, can you think of any way to wait for the ppid to exit, that's<br>
> > less racy than sleep or polling? We can't wait() because we aren't the<br>
> > parent, and inotify (on /proc/pid) is Linux-only and the CLI utilities<br>
> > aren't standard... I'd like a way to wait() on the ppid essentially, that's<br>
> > portable.<br>
><br>
> Sorry, which bit of code are you talking about now, re: the ppid?</p>
<p dir="ltr">The && sleep 0.1 is to give the parent process of the killed sleep time to restore the clipboard.</p>
<p dir="ltr">><br>
> Incidentally, I can't help but wonder whether all this effort of<br>
> managing locking and the clipboard is far more complex than just having<br>
> pass not exit until it's reset the clipboard. The interface would be<br>
> something like:</p>
<p dir="ltr">Woah!! It turns out xclip has a -l option. With -l 1, it could block until it's been pasted, and then restore and quit. Sounds nice...</p>
<p dir="ltr">Question: does pbpaste do that on OSX?</p>