glzr-io / glazewm

GlazeWM is a tiling window manager for Windows inspired by i3wm.
GNU General Public License v3.0
6.66k stars 195 forks source link

Set of Workspaces Per Monitor #582

Open GhoulBoii opened 7 months ago

GhoulBoii commented 7 months ago

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.

FrostyNick commented 7 months ago

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.

GhoulBoii commented 7 months ago

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.

FrostyNick commented 7 months ago

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.

GhoulBoii commented 7 months ago

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.

mischavandenburg commented 6 months ago

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

erlenmeyer316 commented 4 months ago

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

Moving focused windows between workspace on monitor

Moving focused windows between monitors

Focusing monitors

Hopefully that make sense.