on [<modes>]switch_windows [<serial#>] [-|^]<match> { <action> }
This hook is triggered whenever the client changes what it thinks your “current” window is in any given context.
$0 | the old screen number |
$1 | the old window number |
$2 | the new screen number |
$3 | the new window number |
Note that the window might change through forces other than the window keybindings. You can get a pretty good idea when this happens, though, because $0 and $2 will be different.