glzr-io / glazewm

GlazeWM is a tiling window manager for Windows inspired by i3 and Polybar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set of Workspaces Per Monitor

GhoulBoii opened this issue · comments

I would like an option to use the workspaces feature like it is used in suckless dwm.

In dwm, you can assign a set of workspaces per monitor and you can switch your focus between the monitors to access those workspaces. For example, monitor 1 can have 1-5 workspaces which you can access with super+{1,5} and then you can switch to monitor 2 with super+. to the second monitor to access another set of 1-5 workspaces.

I have searched the configs and couldn't find anything to get this behaviour.

I found info about it here: https://github.com/glzr-io/glazewm#workspaces-configuration

For example to force workspaces 6-10 to second monitor:

workspaces:
  - name: "1"
  - name: "2"
  - name: "3"
  - name: "4"
  - name: "5"
  - name: "6"
    bind_to_monitor: 2
  - name: "7"
    bind_to_monitor: 2
  - name: "8"
    bind_to_monitor: 2
  - name: "9"
    bind_to_monitor: 2
  - name: "10"
    bind_to_monitor: 2

I don't have a second monitor, but I've tested display_names and would assume that it works the same in this case too.

Thanks for the response. I did go through that config but that didn't suit what I wanted. I want to have 1-5 workspaces be activated by 1-5 keys on both of my monitors. For example, on monitor 1, I want 1-5 to activate 1-5 workspaces and if i switch to the second monitor, I want the same to happen. Switching between the monitors should happen with another key.

This might be what you're looking for (from auto-generated config file):

keybindings:
  # ...
  # Move focused workspace to a monitor in a given direction.
  - command: "move workspace left"
    binding: "Alt+A"
  - command: "move workspace right"
    binding: "Alt+F"
  - command: "move workspace up"
    binding: "Alt+D"
  - command: "move workspace down"
    binding: "Alt+S"

Not to be mistaken with move to workspace which switches workspaces instead of monitor if I'm not mistaken.

This might be what you're looking for (from auto-generated config file):

keybindings:
  # ...
  # Move focused workspace to a monitor in a given direction.
  - command: "move workspace left"
    binding: "Alt+A"
  - command: "move workspace right"
    binding: "Alt+F"
  - command: "move workspace up"
    binding: "Alt+D"
  - command: "move workspace down"
    binding: "Alt+S"

Not to be mistaken with move to workspace which switches workspaces instead of monitor if I'm not mistaken.

This seems like a good solution but the problem is that if I have multiple windows then the whole workspace containing the windows get transferred over. This behaviour is i3wm like. I would rather have more importance given to the windows than the workspaces when working in a multi monitor setup.

This might be what you're looking for (from auto-generated config file):

keybindings:
  # ...
  # Move focused workspace to a monitor in a given direction.
  - command: "move workspace left"
    binding: "Alt+A"
  - command: "move workspace right"
    binding: "Alt+F"
  - command: "move workspace up"
    binding: "Alt+D"
  - command: "move workspace down"
    binding: "Alt+S"

Not to be mistaken with move to workspace which switches workspaces instead of monitor if I'm not mistaken.

Thank you this is exactly what I needed

GlazeWM is great by the way. It's made moving to windows bearable for me. I tried another (komorebi and whkd) just because it looked looked similar to yabai and skhd, but GlazeWM is superior by far imo. Looking forward to to new Rust rewrite.

That said, this feature would be a massive improvement my workflow.

1 workspace config with up to 10 (0-9) workspaces, which is replicated on each monitor and the keybinds for focusing workspaces would work on the currently focused monitor. Same idea for moving focused windows to a workspace. It only happens on the focused monitor.

It does create a new case where keybinds and functionality would be needed to move focused windows to a desired monitor or focus a specific monitor. I think moving windows to the first workspace on the monitor would be acceptable and simplify keybinds. Once a window is in the first workspace on a specific monitor the standard keybinds and existing functionality could be used to change it work a different workspace on that monitor.

Example:

Assumptions: 3 monitors. Each monitor has 10 workspaces (0-9).

Focusing workspaces on a monitor

  • If monitor 1 is focused and I press Alt+3, then workspace 3 on monitor 1 gets focus.
  • If monitor 2 is focused and I press Alt+4, then workspace 4 on monitor 2 gets focus.
  • If monitor 3 is focused and I press Alt+9, then workspace 9 on monitor 3 gets focus.

Moving focused windows between workspace on monitor

  • If a window in workspace 3 on monitor 1 is focused and I press Alt+Shift+7, then the focused window would get move to workspace 7 on monitor 1
  • If a window in workspace 4 on monitor 2 is focused and I press Alt+Shift+1, then the focused window would get move to workspace 1 on monitor 2
  • If a window in workspace 9 on monitor 3 is focused and I press Alt+Shift+3, the focused window would get move to workspace 3 on monitor 3

Moving focused windows between monitors

  • If a window in workspace 7 on monitor 1 is focused and I press Alt+Ctl+Shift+3, the focused window would get moved to workspace 1 on monitor 3
  • If a window in workspace 1 on monitor 2 is focused and I press Alt+Ctl+Shift+1, the focused window would get moved to workspace 1 on monitor 1
  • If a window in workspace 3 on monitor 3 is focused and I press Alt+Ctl+Shift+2, the focused window would get moved to workspace 1 on monitor 2

Focusing monitors

  • If a window on monitor 1 is focused and I press Alt+Ctl+3, the focus would be change to window 1, in workspace 1, on monitor 3
  • If a window on monitor 2 is focused and I press Alt+Ctl+1, the focus would be change to window 1, in workspace 1, on monitor 1
  • If a window on monitor 3 is focused and I press Alt+Ctl+2, the focus would be change to window 1, in workspace 1, on monitor 2

Hopefully that make sense.