[Xmonad] Make some workspaces prefer some heads

David Roundy daveroundy at gmail.com
Mon Aug 27 10:55:28 EDT 2007

On Mon, Aug 27, 2007 at 02:46:26PM +0200, Kai Grossjohann wrote:
> I find that the current workspace switching model does not match my
> usage pattern.  My usage pattern is that I tend to use the same head to
> view a given workspace.
> Is there anyone who prefers a similar working style and who could
> provide code to implement it?  I know that you guys usually tell me
> that I can do it myself and that it is very easy, but this time, I am
> doubtful.

I'd say that you've good reason to be doubtful.  I think it would be
possible to implement via a Layout modifier, but it would be extremely
scary and ugly code.

> My working style:
>   - There should be a command to say "workspace X prefers head Y" (for
>     example with X being the currently focused workspace and Y the
>     currently focused head).
>   - When switching to a workspace, display it on the preferred head.
>     (If there is no preferred head, have some rule such as to always
>     show it on the second head.)
>   - There should be a way to say that I want to view workspace X on the
>     current head, no matter what X's preferred head is.

I've made a similar proposal, which was shot down, which was to make every
workspace associated with a screen, so then there would be two (or more?)
sorts of keybindings.  You could have a keybinding that ignores this
association (and thus reproduces current behavior with a little more code),
and one which shows a particular workspace on its current screen.  The user
could select the behavior they prefer.  This isn't quite the same as what
you request, but I believe it'll work just as well with your work flow.

This would simplify parts of the code, while making some of the existing
behavior more complicated.  We'd no longer have a "hidden" list in
ScreenSet, but instead each Screen would have a Stack of Workspaces (thus
holding both a visible Workspace and zero or more hidden Workspaces.  Note
that you'd also gain the potential to implement keybindings for things like
rotating through the Workspaces on a given Screen.

It'd be beautiful and simple in xmonad's core, but nightmarish to implement
in XMonadContrib (basically involving forking StackSet, as far as I can
David Roundy

More information about the Xmonad mailing list