FR: Workspace cursors

Here's another idea that had been tossed around on IRC, a list of workspace "cursors". This was born from a discussion regarding Enlightenment virtual desktops, and on further inspection it turns out that simulating a cursor was the real feature. When maintaining a large list of workspaces, navigating between them is an issue. Having a list of pointers or cursors that could be accessed quickly (single keypress bound) or linearly (next/prev cursor) would be useful to "jump" between tasks. The idea would be that given an array of cursors, the current cursor is constantly updated with the current workspace. Changing to another cursor jumps to its last known location and it becomes the new current cursor. Here's a quick sketch in perlesque pseudo-code: my @cursors = [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", ]; my $currentCursor=0; add post-workspace change hook, or attach the code to the planer keybindings used to change workspaces: $cursors[$currentCursor]=getCurrentWorkspace(); goto-next-cursor: if $currentCursor < 9 then $currentCursor++; setWorkspace($cursors[$currentCursor]); goto-prev-cursor: if $currentCursor > 1 then $currentCursor--; setWorkspace($cursors[$currentCursor]); You could get fancy and change the array boundchecking to use the length of the array, or make it a ring and just loop (nice idea). Comments? ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3

* On Monday, April 27 2009, Russell Adams wrote:
Here's another idea that had been tossed around on IRC, a list of workspace "cursors". This was born from a discussion regarding Enlightenment virtual desktops, and on further inspection it turns out that simulating a cursor was the real feature.
When maintaining a large list of workspaces, navigating between them is an issue. Having a list of pointers or cursors that could be accessed quickly (single keypress bound) or linearly (next/prev cursor) would be useful to "jump" between tasks.
The idea would be that given an array of cursors, the current cursor is constantly updated with the current workspace. Changing to another cursor jumps to its last known location and it becomes the new current cursor.
...
You could get fancy and change the array boundchecking to use the length of the array, or make it a ring and just loop (nice idea).
Comments?
I'm not sure if XMonad.Actions.TopicSpace came up in the discussion, but it does some of what you want because it keeps track of the previously viewed workspaces, and has keybindings to the n'th last viewed workspace. So with a binding like:
[ ((modm, k), switchNthLastFocused myTopicConfig i) | (i, k) <- zip [1..] [xK_1 .. xK_9]]
Lets you cycle the view among the last n+1 other workspaces by repeatedly calling that action. Ex. M-4 will cycle the last 5 workspaces (but only in one direction, though I suspect that the list of recently visited workspaces could be modified to make the other direction possible) The Stack datatype from XMonad.StackSet is a functional way to implement a cursor on an array (and is never out of bounds). That module already exports functions for the wrapping case. You can keep track of the state as above (ex. in an IORef, or in X11 as TopicSpace does). Cheers, Adam

Excerpts from Adam Vogt's message of Tue Apr 28 06:30:11 +0200 2009:
* On Monday, April 27 2009, Russell Adams wrote:
Here's another idea that had been tossed around on IRC, a list of workspace "cursors". This was born from a discussion regarding Enlightenment virtual desktops, and on further inspection it turns out that simulating a cursor was the real feature.
When maintaining a large list of workspaces, navigating between them is an issue. Having a list of pointers or cursors that could be accessed quickly (single keypress bound) or linearly (next/prev cursor) would be useful to "jump" between tasks.
The idea would be that given an array of cursors, the current cursor is constantly updated with the current workspace. Changing to another cursor jumps to its last known location and it becomes the new current cursor.
...
You could get fancy and change the array boundchecking to use the length of the array, or make it a ring and just loop (nice idea).
Comments?
I'm not sure if XMonad.Actions.TopicSpace came up in the discussion, but it does some of what you want because it keeps track of the previously viewed workspaces, and has keybindings to the n'th last viewed workspace.
I was going to advertise for TopicSpace but I didn't have to :) I can confirm that the goto n'th last viewed workspace + workspacePrompt let me manage 50 workspaces seamlessly.
So with a binding like:
[ ((modm, k), switchNthLastFocused myTopicConfig i) | (i, k) <- zip [1..] [xK_1 .. xK_9]]
Lets you cycle the view among the last n+1 other workspaces by repeatedly calling that action.
Ex. M-4 will cycle the last 5 workspaces (but only in one direction, though I suspect that the list of recently visited workspaces could be modified to make the other direction possible)
I was recently thinking of something similar. A binding could allow to pop the workspaces from the head of the last-viewed list (actually push them back to the end). Best regards, -- Nicolas Pouillard
participants (3)
-
Adam Vogt
-
Nicolas Pouillard
-
Russell Adams