help with user function: (de)iconify/move

Hello, I don’t have much experience with writing fvwm functions. What I’d like to accomplish is to (de)iconify a window if it’s on the current desk, and move it to the current desk deiconified if it’s not on the current desk.

I’ve tried adding to a function different combinations of the following without perfect success: “Iconify toggle Current(CurrentDesk)”, “MoveToPage 0p 0 Current(!CurrentDesk)”, “Iconify False Current(!CurrentDesk)”.

Any help much appreciated. Regards,

Andrej

DestroyFunc Foo
AddToFunc Foo
+ I Next (CurrerntDesk, $0) Iconify
+ I TestRc (NoMatch) Next ($0, !CurrentDesk) MoveToDesk $[desk.n]
+ I TestRc (Match) Next ($0, CurrentDesk, Iconified) Iconify

Then you can call it thus:

Foo someWindowClass

Haven’t tried it – conceptually it looks fine though.

– Thomas Adam

Thank you. However, I’m not sure how to use this – I want to set it up so it gets executed when I press a mouse button over the FvwmIconMan; so no classes, I guess.

*FvwmIconMan: action mouse 1 n sendcommand Foo

Will run the function “Foo” in a window context.

DestroyFunc Foo
AddToFunc Foo
+ I ThisWindow (CurrerntDesk) Iconify
+ I TestRc (NoMatch) ThisWindow (!CurrentDesk) MoveToDesk $[desk.n]
+ I TestRc (Match) ThisWindow ($0, CurrentDesk, Iconified) Iconify

But now you’re making it inflexible.

– Thomas Adam

Thanks for the input. I achieved the desired result with this:

DestroyFunc Foo
AddToFunc Foo
+ I ThisWindow (CurrentPage) Iconify toggle
+ I ThisWindow (!CurrentPage) MoveToPage $[page.nx] $[page.ny]
+ I ThisWindow (!CurrentPage) Iconify False

Which is of course, completely different to your original question, but well done.

– Thomas Adam

Yes, it was a bit poorly phrased, sorry for that. Enjoy,

Andrej