Set workspaces to specific screens.

Issue #1 resolved
David Smith created an issue

I use three monitors. i want to have set workspaces/tags on each monitor.

1 2 3 = screen 1

3 4 5 7 8 = screen 2

9 10 = screen 3

I can see no way to “pin” the workspaces. Is this something undocumented, have i missed it or is it not implemented.

Like the project a lot btw 😃

Comments (4)

  1. Nate Maia repo owner

    Hey thanks.

    There's no way to do something like this currently, not really any need due to the way they work. Monitors and workspaces function much like xmonad in that; any workspace can be visible on any monitor, if both are visible (assigned to a monitor) then they are swapped.

    e.g.

    • 2 monitors, 10 workspaces
    • ws 1 on mon 1
    • ws 2 on mon 2

    If workspace 1 is active on mon 1 and I want to view workspace 2

    yaxwm -c ws view 2
    

    swaps workspaces, ws 2 on mon 1 and ws 1 on mon 2. The reverse of this could also be done, if the new workspace is not visible then no swapping is done and the windows from the previously active workspace are hidden.

    This is just a better way of doing it IMO and one of the major features of yax over something like dwm or awesome, as you're not limited in what workspaces are where at a given moment. I used to have it set up the way you're referring to much earlier in development where workspaces would be statically assigned to monitors but wasn't very happy with it.

    Workspaces really only exist as a small struct with a list of windows and some settings for how it should be layed out, in reality all that's happening when changing workspaces is windows on non-visible workspaces are moved to negative coordinates to "hide" them and the new workspaces windows are moved into view and arranged. I'm not sure that this is the most effective or simple way of handling multihead+multiws setups but it's the way I prefer.

    One thing I could be swayed on is defining the initial workspace to assign to a given monitor but this can already be done by stringing together a few commands.

    e.g.

    # view ws 3 on monitor 2
    yaxwm -c mon view 2
    yaxwm -c ws view 3
    
  2. Nate Maia repo owner

    I'll consider this resolved then?

    Not intending to be harsh or put people off, I've just used various window managers in the past like i3 that do the assignment and I just prefer my current method.

    I believe with a bit of scripting around the yaxwm commands something that resembles assignment like you want can be done.

    An associative array with the assignments, then when asked to switch to an index check the array for which monitor it should be shown on and (if needed) move there before switching. Then replace the yaxwm -c ws ... commands in your binds to call the script instead.

  3. Nate Maia repo owner

    I did end up doing this in the end but it's not the default behaviour.

    If you still have any interest there's also most of the functionality documented now.

    Cheers

  4. Log in to comment