WindowList and changing the 'Alt+Tab' functionality

Hi all:

So, I am away from my Linux box, and will be for probably 2 days or so, and I had a question come to mind, and I just had to ask:

Is it possible to FORCE WindowList to do following:
1-only show/include applications that are maximized (or !Iconified) in size.
2-(I dont know if this functionality is already there, but) if I have 3, 4, 5…N number of non-iconified applications that I want in my WindowList-ing, that after I look at app A, the next time I press my Key bound to windowList, it automatically takes me to B, then to C, then back to A (all of this dependent on the order in which they were focused on)?

After looking at the fvwm man page, I think that I can use the style via the FPSortWindowListByFocus style to get the window listing in the order of focusing, but how can I enforce the looping of the applications, forcing the list to loop back around automatically when we come to the end of the list of windows that match the criteria…???

Could something like the following work:

+ I Next (Maximized, CirculateHit) WarpToWindow

Could this above code just cycle through the WindowList, in a ‘forward’ mottion, warping to each window that is IN THE LIST, and Maximized, and ‘findable’? I just think that it would be cool to be able to search through the list of windows that match a certain criteria, and only through those windows, excluding all others…

If anyone has any ideas - or if they’ve tried something like this in the past, it would great to get some pointers.

Thanks as always,
Skender

You don’t take a break?

It probably is. I’d be far more inclined though to look at using FvwmWindowMenu as an alternative.

For that you would need a function. I did something similar (albeit crudely) to loop back round from start to finish, It is by no means perfect:

SetEnv DIR Next

AddToFunc FocusRaiseAndStuff
	  + I Iconify off
	  + I Focus
	  + I Raise
	  

AddToFunc SwitchWindow
  + I $[DIR] (CurrentPage, !Iconic, !Sticky) FocusRaiseAndStuff
  + I Deschedule 134400
  + I PipeRead `[ "$[DIR]" == "Prev" ] && \
	echo 'SetEnv NDIR Next' || \
	echo 'SetEnv NDIR Prev'`
  + I Schedule 700 134400 SetEnv DIR $[NDIR]


Key   Tab    A       M          SwitchWindow

You can adapt it, of course, to suit your needs.

– Thomas Adam

Occasionally Thomas… occasionally. I work… alot - and only part time on the FVWM system.

I’ll see if I can get the function you passed on to work. I’m definately going to have to make it work for (I think) “warping to the window” (So that I can loop independent of desks).

Thanks for the starter code. I appreciate it. If you have any more thoughts… or even comments, I’ll gladly, gladly take them.

I’ll post my code when I get it working if someone else wants to do something similar in the future.

  • Skender

All:

So, after getting back to FVWM, I’ve tried using your code Thomas, only changing the func to look at all desk’s,not just the current desk.

SetEnv DIR Next

DestroyFunc SwitchWindow
AddToFunc   SwitchWindow
+ I $[DIR] (!Iconic, !Sticky) FocusRaiseAndStuff
+ I Deschedule 134400
+ I PipeRead `[ "$[DIR]" == "Prev" ] && \
   echo 'SetEnv NDIR Next' || \
   echo 'SetEnv NDIR Prev'`
+ I Schedule 700 134400 SetEnv DIR $[NDIR]

        AddToFunc FocusRaiseAndStuff
        + I Iconify off
        + I Focus
        + I Raise
        + I WarpToWindow

However, by integrating this into my .fvwm2rc I appear to have done something wrong, As I stated before, I need the function to cycle through only a few specific applications, and to ignore some others. To do this, I set a style of

WindowListSkip

on the windows I didni’t want to be considered by this above function - but now I can’t get these windows with the WindowListSkip style to be considered by any function. All I want is to have these two apps, Foo_a and Foo_b, considered in the function below and ignored by the function above. (the function you gave me Thomas works perfectly, but now my function below doesn’t work at all)

below is the code of my function: The only thing I have done to it, to try and make it work along side Thomas’s function is change the Next condition to consider OnlySistSkip, instead of CirculateHit as one of the conditions. If anyone can tell me why the first of the functions can’t see my two WindowSkipList applications, I would appreciate it.

Here is the function that worked until I changed the Style of Foo_a and Foo_b, and then put OnlySkipList into the Next condition. According to the Man page:

Style Foo_a WindowListSkip
Style Foo_b WindowListSkip

DestroyFunc FuncFocusAdditionalApps
AddToFunc   FuncFocusAdditionalApps
+ I FuncAdditionalApps "Foo_a" "Foo_b"

        DestroyFunc FuncAdditionalApps
        AddToFunc   FuncAdditionalApps       
        + I Next ($$0, !Focused, OnlyListSkip) Function MakeVisible
        + I TestRc (Match) Break
        + I Next ($$1, !Focused, OnlyListSkip) Function MakeVisible

        # Helper function
        DestroyFunc MakeVisible
        AddToFunc MakeVisible
        + I Iconify off
        + I Raise
        + I GoToDesk 0 0
        + I Focus        

But it just dosn’t seem to work. I am sure that I am misunderstanding something fundamental about WindowList or how add ListSkip changes things, but after reading the man page, I can’t see it.

thanks,
Skender

Yup.

You have two options. In the line:

+ I $[DIR] (!Iconic, !Sticky) FocusRaiseAndStuff

You could add (as an explicit statement)

CirculateSkip

… to the list of conditionals. Or, if it really is just windows “Foo_a” and “Foo_b” that you want to use, then you can do:

+ I $[DIR] ("Foo_a | Foo_b", !Iconic, !Sticky) FocusRaiseAndStuff

… but I suspect the former approach to be more flexible to your needs.

– Thomas Adam

Correct me if I’m wrong, but CirculateSkip cannot be used as a conditional statement, correct?

e.g., the following code DOESN’T doesn’t look at non-sticky,non-focues applications not included in the CirculateHit window list:

+ I Next (!Sticky, !Focused, CirculateSkip) FuncMyFoo

So, there is no actual way to establish one set of windows as “in the window list” and one set of windows “outside the window list” and be able to cycle through the “outside the window list” set only… is this right?

I can exclue windows from consideration (using Style CirculateSkip), but I can’t set my window list into two lists, and be able to cycle through each list as a distinct list by using CirculateSkip… correct?

-Skender

Of course it can. It’s an implicit operation with some conditionals though. There’s a two-step process to it, if you want to think of it in that way. For instance:

Style gvim CirculateSkip

… would mean that in any conditional commands that I use, say “All”, or “Next”, the window would not be considered. This can be overriden though in the conditional statement itself (see below).

What you’re asking, in the above, is for the next window that is not sticky, is not focused, and is NOT in the skip list, to invoke FuncMyFoo on. But in this instance, “CirculateSkip” is redundant, as it’s a given.

What do you mean by “window list”? If you mean the stack-ring of windows, then look at the “CirculateHit” option, which is the negation of “CirculateSkip”.

Can you just clarify for me, what it is you’re wanting to do? :slight_smile:

– Thomas Adam

the problem that I am trying to solve is that I need to have two functions: funcA and funcB

funcA needs to consider only 2 specific applications (foo_a and foo_b).

funcB needs to be able to consider N number of applications but it will NEVER consider the app’s used in funcA.

funcB would use the code supplied by Thomas Adam, and funcA uses the code I specified above.

I have tried using CirculateSkip as a Style on foo_a and foo_b to make them invisible to funcB,

Style foo_a CirculateSkip
Style foo_b CirculateSkip

and then using + I Next (…, !CirculateHit) in the conditional clause of FuncA so that it should be able to see foo_a and foo_b, but this isn’t making foo_a and foo_b visible at all.

Anybody have any thoughts???

-Skender

OK.

You want to watch that Thomas Adam guy. He’s weird…

Perhaps you want something like this:

# Before your function...
Style foo_a CirculateSkip
Style foo_b CirculateSkip

AddToFunc somefunc
+ I Next(foo_a, foo_b, CirculateHit) .....

… which (to me) says: “If foo_a or foo_b are next, then do something.” To me, that also works. :slight_smile:

– Thomas Adam

So, If I understand you correctly:

If I say CirculateSkip as the Style, and then say CirculateHit in the conditional statement, the statement will be able to “see” foo_a and/or foo_b? However, if I DO NOT include CirculateHit in the conditional statement, foo_a and foo_b remain ‘unseen’?

Yep. That’s it exactly. :slight_smile:

– Thomas Adam

Seriously Thomas – You’re the man.

You’re welcome. And to think I don’t even know your name… I don’t even know in which country you live in. (Not that it matters, but seeing as I reply to almost all of your replies, I’d love to know. ) :slight_smile:

– Thomas Adam

I want to correct several inaccuracies in this thread.

Actually, there is no such condition “CirculateSkip”, so in the “Next” command above, it would be taken as the window name.

This is not accurate. “All” unlike “Next” already implies “CirculateHit”. To override this (i.e. to make it skip windows like “Next” does), use “All (!CirculateHit)”.

This would not be correct, since it only matches windows with name “foo_a” and “foo_b” simultaneously, i.e. pretty much no windows. To specify alternative names, use:

Next ("foo_a|foo_b", CirculateHit) ...

Indeed. Thanks for that.

– Thomas Adam

I think, noone answered the original questions yet.

Yes, this is possible.

WindowList (!Iconic)

This is achieved by “CurrentAtEnd” option:

Key Tab A M WindowList (!Iconic) Root c c CurrentAtEnd, NoDeskSort