2 # lyx-remote - opens files in a running LyX
3 # © 2002 Ronald Florence
4 # ron@18james.com, 16 Dec 2002, 18 May 2003
6 [ $# -ne 1 ] && { xmessage -nearmouse "Usage: $0 lyx-file"; exit; }
7 PIPE=`perl -n -e 'print if s/^.serverpipe\s+"(.+)"/$1/;' ~/.lyx/preferences`
8 [ "X$PIPE" = "X" ] && { xmessage -nearmouse "No lyxpipe defined."; exit; }
10 running=`ps -uxc | perl -n -e 'print if s/.+\s+(lyx)$/$1/;'`
11 if [ "X$running" = "X" ]
13 rm -f $PIPE.in $PIPE.out
15 PATH=$PATH:/usr/local/bin:/sw/bin
16 DISPLAY=${DISPLAY-localhost:0.0}
22 echo "LYXCMD:lyx-remote:file-open:$1" > $PIPE.in
26 xmessage -nearmouse "Hmmm. LyX is running but there is no server pipe."