Hi,
I try to communicate over SendMsgAndGet with a shell script but it doesn’t work. With the perl ComExample it works.
Here’s my test code:
FvwmScript]Init
Begin
Set $pid = (GetPid)
Set $ComName = {ComExample-}$pid
Set $DATADIR = {/home/tf/}
Set $Bash = {/usr/bin/bash}
Do {Exec }$DATADIR{pipeout.sh }$ComName{ &}
End
:
:
Widget 1
Property
Type ItemDraw
Size 24 24
Position 32 104
Flags NoFocus NoReliefString Left
Main
Case message of
SingleClic :
Begin
Do {echo Play clicked}
Set $tmp = (SendMsgAndGet $ComName {Play} 0)
End
End[/code]
Bash script]#!/bin/bash
ComName=$1
inpipe=/home/tf/.fvwm-nightshade/.tmp-com-in-$1
outpipe=/home/tf/.fvwm-nightshade/.tmp-com-out-$1
echo $inpipe >> ~/.xsession-errors
trap “rm -f $inpipe” EXIT
trap “rm -f $outpipe” EXIT
if [[ ! -p $inpipe ]]; then
mkfifo $inpipe
fi
if [[ ! -p $outpipe ]]; then
mkfifo $outpipe
fi
while true
do
if read line <$inpipe; then
if [[ “$line” == ‘quit’ ]]; then
break
fi
echo $line >> ~/.xsession-errors
fi
done
echo “Reader exiting” >> ~/.xsession-errors
rm -f $inpipe
rm -f $outpipe[/code]
As I send over another terminal a command to the pipe like
echo testem > /home/tf/.fvwm-nightshade/.tmp-com-in-ComExample-10220
the “testem” occurs in .xsession-errors …
Any clue?
Thanks,
Thomas