As I see it, you have 2 options here:
- Have your script pretend to be user interaction
- Control the STDIN filehandle
Your use of xautomation is an example of the first. There are other options in this category, however, I find these kinds of solutions to be kludgey in general.
Otherwise you have to control the STDIN filehandle. I know of no way of stealing the standard input of a process away from its initial input (although it is within the realm of the plausible). This leaves you with needing to open splay from Perl.
However, you can be pretty subtle about this if you are careful. Create an splay proxy program that mixes lines read from a named pipe (which you could map to the PID of the splay instance) into the STDIN. You could even replace your real splay with the proxy, moving the real thing to splay-bin or something to that effect. Now, if you want to insert lines into your splays STDIN, all you have to do is write to the named pipe and your proxy handles things nicely.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.