Thomas Adam wrote: > Then you can make use of blocking PipeRead to do things like: > > DestroyFunc foo > AddToFunc foo > + I PipeRead `echo Move` > + I PipeReaad `[ $[w.x] -lt $SOME_VALUE ] && echo "Move somewhere else"`
FvwmEvent can be used to trigger the check of the window placement: DestroyFunc StartFunction AddToFunc StartFunction + I Module FvwmEvent + I Module FvwmTaskBar + I Wait FvwmTaskBar + I Next (FvwmTaskBar, CirculateHit) MaintainWorkingArea DestroyFunc MaintainWorkingArea AddToFunc MaintainWorkingArea + I SetEnv WORKAREA_LEFT_MARGIN 0 + I SetEnv WORKAREA_RIGHT_MARGIN 0 + I SetEnv WORKAREA_TOP_MARGIN $[w.height] + I SetEnv WORKAREA_BOTTOM_MARGIN 0 + I EwmhBaseStruts 0 0 $[w.height] 0 *FvwmEvent: Cmd *FvwmEvent: configure_window "Current CheckWindowPlacement" DestroyFunc CheckWindowPlacement AddToFunc CheckWindowPlacement + I PipeRead '[ $[w.x] -lt $[WORKAREA_LEFT_MARGIN] ] && echo Move $[WORKAREA_LEFT_MARGIN]p w0' + I PipeRead '[ $[w.y] -lt $[WORKAREA_TOP_MARGIN] ] && echo Move w0 $[WORKAREA_TOP_MARGIN]p' Note that CheckWindowPlacement only assures that the window can not escape the left and top of the working area which is sufficient in my case. All other cases would need more complex logic (e.g. handle cases where window is larger than working area). This could be easily done by a shell script on the other hand. Chris