You are not logged in.
Is there a tool, eg like wmctrl, that can list windows on current workspace and indicate their alt-tabbing order?
"wmctrl -l" doesn't do this, it lists them just in order of window id, which doesn't seem to allow to derive their alt-tab "priority" though, if I didn't miss anything.
Edit: Btw I think the alt-tab order is also called "Z-order", correct?
(What I'm doing just if you're interested: I have 2 monitors and the secondary one always has VLC in 'above all'+'on all workspaces' mode. When I switch workspaces, VLC is auto-focussed, so I write a script that will automatically "press" alt+tab once after every workspace switch so the ever-static VLC window is "ignored" and focus is always on the "real use" apps on the main monitor. Simply sending alt+tab via xdotool however isn't good enough because I tend to hold ctrl+alt key as they are shiftkeys for workspace-switching key combos, so they'd get lifted by the alt+tab simulated press. So instead I want to switch the window focus via a "true" commandline solution.)
Edit 2:
The only way I just found out so far is
xwininfo -root -tree | grep -o "0x[a-f0-9]* [^(].*"
#and check the ids against all windows from the current desktop, which are obtained by
wmctrl -d
#to find our current desktop index and then
wmctrl -l
#and filter those for current desktop index and then for the ids from xwininfo..Edit 3:
Arrgh the above way is NOT correct! The first few windows were ok but then the order would diverge from order shown in alt+tab.
Really weird, it seems always correct except when chromium windows are involved, then it's "almost" correct.
Also this method has another big problem, xwininfo output will need to be processed in loops that will involve grep, and due to calling this external stuff cause huge time overhead, resulting in the whole script to take like 1-2s to complete on each workspace swap - unusable. D:
Last edited by millus (2021-12-17 00:59:19)
Offline
The alt+tab order isn't defined. Window managers will either use the stack position or he activation history.
W/ a little luck your WM maintains that in _NET_CLIENT_LIST_STACKING or _NET_CLIENT_LIST or another property on the root window (xprop -root) but it could be secret to the WM
Does xfwm4 provide a dbus interface (and maybe method to trigger the desired alt+tab dialog)?
Offline