On Thu, 17 Jan 2002, John Levon wrote:

> try
>
> LYXCMD:hello:file-open:file.lyx

that works. thanks!

in which case, that triggers a bug report: the file-open command isn't
documented or even mentioned in Help -> Reference Manual (alteast not in
1.1.6fix3).

> > Then you could ship lyx with a little script that opens new documents in a
> > running lyx from the command line. You could call it lyxopen or something.
>
> perhaps.

Maybe this idea could be added as an example in the manual that talks
about the lyxpipes?

Here's how I've just implemented it in bash:

# open a file from the command line in a running lyx
# (spawn a new lyx if needed)
# depends on realpath, a small bianry that returns the full path
# of the given file (realpath is part of the dwww package on debian)
# [EMAIL PROTECTED] jan 02
function lyxopen () { \
        lyxpipe="$HOME/local/lyx/lyxpipe.in";
        fullpath=`realpath $*`;
        if [ -p $lyxpipe ]; then \
                command echo "LYXCMD:lyxopen:file-open:$fullpath" \
                        > $lyxpipe; \
        else \
                command lyx $fullpath &\
        fi \
                                        }

It works, but it depends on a little program called realpath (part of the
dwww debian package) to get the full path of the file concerned. I guess
this could be done instead with perl or something.

But this works for me anyway. :) Because I use pybliographic with lyx to
insert citations (using lyxpipe), it's important for me to only have one
lyx at a time, atleast for documents I'm changing.

Cheers,
Matthew.

Reply via email to