Re: FVWM: PipeRead

From: Dan Espen <dane_at_mk.telcordia.com>
Date: Fri, 04 Apr 2003 22:52:51 -0500

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 *FvwmButtons: Back $bg"'

Watch the semicolons.

I didn't test too carefully, to leave you some fun.

-- 
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 - 21:55:16 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:54 BST