The goal is to replicate the user experience found in KDE or Gnome, where workspaces are shared across all monitors and can be switched simultaneously.
In KDE and Gnome, there is no concept of per-monitor workspaces by default—there is a single, unified workspace that spans all monitors. It is possible to decouple them, but this is not the default behavior.
In Hyprland, each monitor has its own set of workspaces. The purpose of this script is to provide similar functionality: with a single command, all monitors switch their workspaces simultaneously and in the same direction.
block-beta
columns 3
M1(("Monitor #1")):1
space:1
M2(("Monitor #2")):1
space:3
block:Monitor1:1
W1
space
W2
space
W3
space
W4
end
space:1
block:Monitor2:1
W5
space
W6
space
W7
space
W8
end
space:1
block:Label:1
blockArrowId1<[" "]>(left)
LW1["Workspace M #1"]
space
LW2["Workspace M #2"]
blockArrowId2<[" "]>(right)
end
space:1
style Monitor1 fill:#fff9c4,stroke:#fff176,stroke-width:4px
style Monitor2 fill:#fff9c4,stroke:#fff176,stroke-width:4px
style Label fill:#fff,stroke:#fff,stroke-width:0px
style LW1 fill:#fff,stroke:#fff,stroke-width:0px
style LW2 fill:#fff,stroke:#fff,stroke-width:0px
M1 --"current"--> W2
W2 --"prev"--> W1
W2 --"next"--> W3
M2 --"current"--> W6
W6 --"prev"--> W5
W6 --"next"--> W7
block-beta
columns 3
M1(("Monitor #1")):1
space:1
M2(("Monitor #2")):1
space:3
block:Monitor1:1
W1
space
W2
space
W3
space
W4
end
space:1
block:Monitor2:1
W5
space
W6
space
W7
space
W8
end
space:1
block:Label:1
blockArrowId1<[" "]>(left)
LW1["Workspace M #1"]
space
LW2["Workspace M #2"]
blockArrowId2<[" "]>(right)
end
space:1
style Monitor1 fill:#fff9c4,stroke:#fff176,stroke-width:4px
style Monitor2 fill:#fff9c4,stroke:#fff176,stroke-width:4px
style Label fill:#fff,stroke:#fff,stroke-width:0px
style LW1 fill:#fff,stroke:#fff,stroke-width:0px
style LW2 fill:#fff,stroke:#fff,stroke-width:0px
M1 --"current / prev"--> W1
W1 --"next"--> W2
M2 --"current / prev"--> W5
W5 --"next"--> W6
block-beta
columns 3
M1(("Monitor #1")):1
space:1
M2(("Monitor #2")):1
space:3
block:Monitor1:1
W1
space
W2
space
W3
space
W4
end
space:1
block:Monitor2:1
W5
space
W6
space
W7
space
W8
end
space:1
block:Label:1
blockArrowId1<[" "]>(left)
LW1["Workspace M #1"]
space
LW2["Workspace M #2"]
blockArrowId2<[" "]>(right)
end
space:1
style Monitor1 fill:#fff9c4,stroke:#fff176,stroke-width:4px
style Monitor2 fill:#fff9c4,stroke:#fff176,stroke-width:4px
style Label fill:#fff,stroke:#fff,stroke-width:0px
style LW1 fill:#fff,stroke:#fff,stroke-width:0px
style LW2 fill:#fff,stroke:#fff,stroke-width:0px
M1 --"current / next"--> W4
W4 --"prev"--> W3
M2 --"current / next"--> W8
W8 --"prev"--> W7
The argument to give to the script is one of the possible directions:
prev
: Move all workspaces to the previousnext
: Move all workspaces to the nextfirst
: Move all workspaces to the first workspacelast
: Move all workspaces to the last workspace
bind = SUPERALT, left, exec, ~/.config/hypr/scripts/workspaces.sh prev
bind = SUPERALT, right, exec, ~/.config/hypr/scripts/workspaces.sh next
bind = SUPERALT, HOME, exec, ~/.config/hypr/scripts/workspaces.sh first
bind = SUPERALT, END, exec, ~/.config/hypr/scripts/workspaces.sh last
This is under the MIT license.
Author: Davide Cardillo [email protected]
Special thanks to Diaoul for sharing useful scripts and concepts related to Hyprland workspace management: Arrange workspace on multiple monitors (Hyprland). That project has inspirated this script.