[xmonad] FR: Workspace cursors

Russell Adams RLAdams at AdamsInfoServ.Com
Mon Apr 27 20:00:11 EDT 2009


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 at AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3


More information about the xmonad mailing list