I use my function keys for specific applications (F1 chrome, F2 terminal, etc). I have a script bound to a shortcut key to activate the right application, and that works, but it doesn't activate the most-recently-focused window. The script lists windows with
wmctrl -lx which seems to list windows by reverse-creation order. Is there any way to ask for or keep track of the order specific windows are activated so I can script "activate the most recent terminal window"?
Alternately, it seems if I was able to get the window stack order maintained by
xfwm4 (which it uses when you cycle through windows), that seems like it would solve my problem as well but I don't see a command line interface to get at that window stack order.