PickAgain: generalized Pick command

It works like the Pick command, but then it calls itself again so you can keep picking windows until you click on root or hit ESC. I think it works great for performing operations on several windows. Plus it works like Pick if run from a window context. It still has some bugs, e.g. it runs twice when used with FvwmIdent, and with Close it doesn’t actually close the windows until you’re done. Any improvements are welcome.

DestroyFunc PickAgain
AddToFunc PickAgain
+ I     Pick $*
# prevent infinite recursion (fvwm actually does this automatically, but only after 512 iterations)
+ I     PipeRead "test $[func.context] == r && echo 'PickAgain $*'"

jpkotta

Nice idea, I’ve added this to my window ops menu :slight_smile:

I’ve used this:

[code]DestroyFunc MultiClose
AddToFunc MultiClose

  • I Pick Close
  • I Schedule 0 MultiClose[/code]

I tried the Repeat, but it doesn’t work for what I use this for. I use it a lot in menus. If I redefine PickAgain as you suggest, it Repeats the menu instead of the command.

Right – Repeat does just that, repeats the last command, which puts a menu operation out of context in this example.

– Thomas Adam

Following this I’ve tried to do a MultiIconify Function but it doesn’t work as expected :

[code]DestroyFunc MultiIconify
AddToFunc MultiIconify

  • I Pick Iconify True
  • I Schedule 0 MultiIconify
    [/code]

When trying to raise the icon (that didn’t have been thumbnailed :frowning: ) it keeps on reiconify. Any ideas ?

I don’t follow you. Can you rephrase that?

– Thomas Adam

Sorry for this, here’s a “better” explanation :slight_smile: (I hope)

I’ve implemented the function in my menu

+                       "Multi Iconify"            MultiIconify

When I launch it, a cursor appear, I click on a window. The window is iconified (no thumbnail is created :frowning: ) and if I click on the icon (mostly the title) the window raise itself and goes back immediately to the iconified state. The only way is to xkill -id .

The problem is one of context. Hence see:

DestroyFunc MultiIconify
AddToFunc MultiIconify
+ I Pick Iconify True
+ I Schedule 0 NoWindow MultiIconify

(As for the thumbnail being created, this implies you’re using FvwmEvent to listen for iconify events).

– Thomas Adam

Thx for the answer thomasadam works like a charm (as usual :smiley:)

To easily have thumbnails I have rewrite a little the function :

[code]DestroyFunc MultiIconify
AddToFunc MultiIconify

  • I Pick Thumbnail
  • I Schedule 0 NoWindow MultiIconify [/code]

I did not manage to do it with FvwmEvent, the iconify/deiconify actions were working but not the thumbnail action :?
I’ve tried :

DestroyModuleConfig FvwmEvent:* *FvwmEvent: Cmd *FvwmEvent: iconify Thumbnail *FvwmEvent: deiconify DeThumbnail
With

[code]DestroyFunc MultiIconify
AddToFunc MultiIconify

  • I Pick Iconify True
  • I Schedule 0 NoWindow MultiIconify [/code]

I’ve also removed

+I Iconify 

At the end of Thumbnail function