>>Date: Tue, 15 Jun 2004 08:14:16 +0200
>>From: "G. Milde" <[EMAIL PROTECTED]>
>>To: LyX Users List <[EMAIL PROTECTED]>
>>Subject: "lyx-remote" script?
>>
>>Dear Lyxers,
>>
>>I would like to see a script, that 
>>   * opens a file in a LyX session, if there is an open one, or
>>   * starts LyX with the file, if there is no LyX running.
>>
>>I thought about checking for ~.lyxpipe, 
>>  if it exists send an open file command there, 
>>  if not start LyX with file.

The lyxpipe files may  be there alone if LyX has been killed
unexpectedly, so this test in not enough robust.
You need to check if there is an active LyX with ps, e.g. in Perl

if ((-e "$ENV{HOME}/.lyxpipe.in") && (grep(/lyx/,`ps -u $ENV{USER}`))) {
# open a buffer through the pipe
}
else {
`$0 $ARGV[0]`
}

I'm unfamiliar with file loading in buffers with the LyX server,
the commented line should be repaced by the correct syntax.

-- 
Jean-Pierre

Reply via email to