A command-line utility for bulk-assigning workspaces to monitors in the Hyprland window manager.
hyprspacefix simplifies the process of assigning multiple workspaces to a specific monitor in Hyprland. Instead of manually configuring each workspace, you can assign an entire range of workspaces to a monitor with a single command.
I use this with shikane to ensure my workspaces are where I want them to be on a dual-monitor setup. This allow Xmonad type workspace management in Hyprland.
git clone https://github.com/simonm/hyprspacefix.git
cd hyprspacefix
go build- Go 1.23.1 or later
- Hyprland window manager
hyprctlmust be available in your PATH
hyprspacefix --name=<monitor-name> --range=<start>-<end> [options]Assign workspaces 1-5 to monitor DP-1:
hyprspacefix --name=DP-1 --range=1-5Assign workspaces 10-20 to monitor HDMI-A-1 with verbose output:
hyprspacefix --name=HDMI-A-1 --range=10-20 --verbosePreview commands without executing (dry run):
hyprspacefix --name=eDP-1 --range=1-3 --dry-run--name: The name of the monitor (required)--range: The range of workspaces to assign, format:start-end(required)--dry-run: Show what commands would be executed without running them--verbose: Enable detailed logging output--help: Display help information
hyprspacefix uses Hyprland's hyprctl command to:
- Configure each workspace in the specified range to be associated with the target monitor
- Move each workspace to that monitor
- Execute all commands in a single batch for efficiency
The tool generates commands like:
hyprctl --batch "dispatch workspace 1 ; moveworkspacetomonitor 1 DP-1"
# and so on...And then applies them in bulk.
MIT Licence.
Contributions are welcome! Please feel free to submit a Pull Request.