CycleRecentWS - gnome-like workspace switching

Hi, The attached patch provides a function to cycle through most recent workspaces with repeated presses of alt-tab (or similar). The order of workspaces previewed during the cycling is not affected, so it can be used to switch between 2 or 3 most commonly visited workspaces. It is possible to expand on this idea, for example by having alt-1 cycle between (most recently seen) emacs windows and alt-2 between browser windows, implementing a kind of "dynamic workspaces". There is some room for improvement - maybe it is possible to ask X about modkeys given only control mask, that way it would be marginally easier to use in config file. Regards, Michal

janeczek:
Hi,
The attached patch provides a function to cycle through most recent workspaces with repeated presses of alt-tab (or similar). The order of workspaces previewed during the cycling is not affected, so it can be used to switch between 2 or 3 most commonly visited workspaces. It is possible to expand on this idea, for example by having alt-1 cycle between (most recently seen) emacs windows and alt-2 between browser windows, implementing a kind of "dynamic workspaces".
There is some room for improvement - maybe it is possible to ask X about modkeys given only control mask, that way it would be marginally easier to use in config file.
Applied, thanks! - Don

On Mon, Mar 31, 2008 at 1:31 PM, Michał Janeczek
It is possible to expand on this idea, for example by having alt-1 cycle between (most recently seen) emacs windows and alt-2 between browser windows, implementing a kind of "dynamic workspaces".
I have added a function to cycle through windows matching a predicate. Also, both cycleRecentWS and cycleWindows now take a function telling how exactly to perform a workspace/window switch. The former might be useful for multi-screen setups (I can't test whether view or greedyView is more convenient). The latter can be used to put the window in the master pane in addition to plainly focusing on it. The side effect of these changes is that type signatures have grown more.. impressive. I hope the examples in documentation help a little bit. Michal

On Mon, Mar 31, 2008 at 11:19 PM, Michał Janeczek
It is possible to expand on this idea, for example by having alt-1 cycle between (most recently seen) emacs windows and alt-2 between browser windows, implementing a kind of "dynamic workspaces".
I have added a function to cycle through windows matching a predicate. [...]
Ok, that's not as convenient as I thought, mainly due to all other bindings being blocked while cycling (that is, it is impossible to start cycling in "different direction" - having started looking for emacs windows and then decide to look for browsers - without relasing mod key). Please discard this patch for now. Regards, Michal
participants (2)
-
Don Stewart
-
Michał Janeczek