I'd like to run a script whenever I switch into or out of a window.
Specifically, I have a "toggle touchpad on/off" script, which i want to run whenever I switch into or out of gvim.
so, is there any kind of hook for that? even something that can be run whenever alt-tab is detected, as long as it can tell what window you're going from/to?
I'm using gnome-shell, if that makes any difference.