Window List

greetings! i’m attempting to obtain a list of all the windows being managed by fvwm…

[code]DestroyFunc MyForEach
AddToFunc MyForEach

  • All (!Iconfied) Echo $[w.id]
    [/code]

but this only seems to grab the CurrentPage; perusing the manual, i don’t see an “AnyPage” type condition so i…

[code]DestroyFunc MyForEach
AddToFunc MyForEach

  • All (CurrentPage !Iconfied) Echo $[w.id]
  • All (!CurrentPage !Iconfied) Echo $[w.id]
    [/code]

but alas, this doesn’t work either. so… please, how can i do this in fvwm? :slight_smile: thanks in advance!

See: “WindowList” in “man fvwm”. See also “FvwmWinList” and “FvwmWindowMenu” as modules.

You want:

 + I All (!Iconified, CurrentDesk) ....

But I suggest you look at the modules, as I mentioned above.

– Thomas Adam

okay… here is everything involved, sorry for being less than explicit earlier. :slight_smile: my configuration looks like this:

[code]DestroyFunc TogglePager
AddToFunc TogglePager

  • I TogglePager-Show $0 $1 $2 $3

DestroyFunc TogglePager-Show
AddToFunc TogglePager-Show

  • I All (!Iconified, CurrentDesk) ThisWindow Exec exec xmessage $[w.id]
  • I All (FvwmPager) Iconify false
  • I $0 $1 $2 $3 TogglePager-Hide $0 $1 $2 $3

DestroyFunc TogglePager-Hide
AddToFunc TogglePager-Hide

  • I All (FvwmPager) Iconify true
  • I $0 $1 $2 $3 TogglePager-Show $0 $1 $2 $3

ALT+P will toggle the pager

Key P A M TogglePager Key P A M
[/code]

which works almost as i would expect except when i bring the page up (via TogglePager-Show) the xmessage windows all have the same contents (0x123456 for example)… oddly enough, if i run the All (!Iconified, CurrentDesk) … line via FvwmConsole, it works just fine with each xmessage window having different text body. :-/

please help.

Sorry for the long post, but I wanted to quote it. I am not sure what it is you’re trying to do – if it is simply hiding/unhiding the pager, then there’s a function to do that in the main FVWM FAQ. :slight_smile:

From the function above, you’re passing the phrase “Key P A M” into each of the functions. Why? It serves no purpose. Note that your parameter passing can be distilled to just this:

$*

for all instances where you have “$0 $1 $2 $3”. Of course, I am still in the dark as to what it is you’re trying to do. If it’s just hiding unhiding the pager based on a condition, then that only takes two functions – perhaps:

DestroyFunc TogglePager
AddToFunc TogglePager
+ I All (FvwmPager, Iconified) TogglePager-Show
+ I TestRc (NoMatch) TogglePager-Hide

DestroyFunc TogglePager-Show
AddToFunc TogglePager-Show
+ I All (FvwmPager) Iconify false

DestroyFunc TogglePager-Hide
AddToFunc TogglePager-Hide
+ I All (FvwmPager) Iconify true

Key P A M TogglePager

I haven’t tested it.

– Thomas Adam

Thomas, thank you for the tips. I will implement them shortly… the real problem is still remaining however. I will restate it in yet another way:

All (!Iconified, CurrentDesk) ...

This code doesn’t do what I want. If I have 5 windows open, I get the same window id 5 times. I do not get the actual window ids for 5 windows. To illustrate further, I get back: 0x111111, 0x111111, 0x111111, 0x111111, 0x111111 instead of 0x111111, 0x222222, 0x333333, 0x444444, 0x555555.

If I issue that All command from the FvwmConsole it works as I would hope… but from the function I quoted earlier, it does not.

I can’t reproduce this. For instance, just to make sure I wasn’t going mad, here’s what I added to my .fvwm2rc file:

AddToFunc a I Any (CurrentDesk, !Iconified) Echo $[w.id]
AddToFunc StartFunction I a

What I get back are seven unique window IDs, as expected. I am unsure what causes you’re issue, then.

That makes no sense to me – as there’s no difference in operation.

– Thomas Adam

SOLVED! for completeness in case anyone else has a similar problem, here is the relevant solution (thanks Thomas):

+ I All (!Iconified, CurrentDesk) ThisWindow Exec exec xmessage $$$$[w.id]