Hello!

I needed a function that would select a particular window on a desktop
every time I press a given key. The function has two parts. The first
part collects all the window IDs (and positions) and saves them to a
file. The second part selects a particular window (with PipeRead).
This is how I did it:

DestroyFunc HelperFnc
AddToFunc HelperFnc
+ I ThisWindow Exec exec echo $[w.y]:$[w.x]:$[w.id] >>~/.fvwm/wlist.txt

DestroyFunc WSelect
AddToFunc WSelect
+ I Exec exec rm -f ~/.fvwm/wlist.txt ; touch ~/.fvwm/wlist.txt
+ I All (!Iconic, CurrentPage, AcceptsFocus) HelperFnc
+ I PipeRead "~/.fvwm/SelectWindow.sh"

SelectWindow.sh is a script that reads the wlist.txt produced by the
first part of the WSelect function, and focuses on a particular
window.

Now, all this is not relaible. Most of the time it works, but somtimes
the wlist.txt file ends up empty or missing some windows. Like if the
PipeRead kicked in too early. Is it possible that the lines in an fvwm
function (WSelect in this case) are NOT executed sequentially?

Regards,
Attila

Reply via email to