PipeRead and graphical tool

So I made a tool in Tk that lets you pick two colors from your wallpaper and then sets your active and inactive colors to them. It works when I invoke it from the command line, and after I hit Apply it says something like “Function PlainDecor #b4cabe #49505b”, which works when typed on the FvwmConsole and I’ve been using it forever. But I’m missing a piece. I thought PipeRead would wait for the script to emit its string and exit, but although it spawns wish, the UI isn’t drawn. Instead I get a round pointer in FVWM, and I have to shell in from another machine and kill wish. What am I missing?

I hope the screenshot posts:

Welcome on board.
Fvwm commands have their own order in how things are processed or executed. Try using the Read command instead of PipeRead. Doesn’t work, make a function where you list each command. Here, read about Function Synchronisation.

Thank you! The way I finally got it working is simple but it uses FvwmCommand, which I didn’t know about.

DestroyFunc PickColorsFromBG
AddToFunc PickColorsFromBG

  • I Exec $./pixelcapture.tcl | FvwmCommand -c

I’m about to upload a package of decors, now that the missing piece is working, and this piece will be in there.

Great. When ready post it here. May help others with the same question or working on a similar script.