Dan Espen <dane_at_mk.telcordia.com> writes:
> Scott Smedley <scottie7_at_tpg.com.au> writes:
> > Hi all,
> >
> > I know this is not valid FVWM syntax but it shows what I'm trying to do:
> >
> > *FvwmButtons: Fore `cat HOME/.fvwmColors | cut -f3`
> > *FvwmButtons: Back `cat HOME/.fvwmColors | cut -f2`
> >
> > DeePBLue>> cat ~/.fvwmColors
> > violetred4 yellow darkcyan antiquewhite
> >
> > What's the best way to get this behaviour? I tried using a PipeRead:
> >
> > PipeRead 'if [ -r $HOME/.fvwmColors ] ; then \
> > fg=`cat $HOME/.fvwmColors | cut -f3 -d" "` \
> > bg=`cat $HOME/.fvwmColors | cut -f4 -d" "` \
> > else \
> > fg=AntiqueWhite \
> > bg=RoyalBlue \
> > fi; \
> > echo "*FvwmButtons: Fore $fg"; \
> > echo "*FvwmButtons: Back $bg"'
> >
> > But if I put this PipeRead command in a file (say 'testPR') & do a:
> >
> > Read testPR
> >
> > from FvwmForm-Talk I get this error message:
> >
> > sh: -c: line 2: syntax error: unexpected end of file
> >
> > Any help/pointers greatly appreciated.
>
> Work from something simpler up to what you need.
>
> As one line, I got the else clause to work like this:
>
> PipeRead 'if [ -r $HOME/.fvwmColors ] ; then fg=`cat $HOME/.fvwmColors | cut
> -f3 -d" "`; bg=`cat $HOME/.fvwmColors | cut -f4 -d" "`; else fg=AntiqueWhite
> bg=RoyalBlue; fi; echo "echo *FvwmButtons: Fore $fg"; echo "echo *FvwmButto
> ns: Back $bg"'
>
> Watch the semicolons.
>
> I didn't test too carefully, to leave you some fun.
And I didn't remember to remove the echos I stuck in there for testing
either.
--
Dan Espen E-mail: dane_at_mk.telcordia.com
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri Apr 04 2003 - 22:00:36 BST