From 7d2cf97ea6ad837b7496a24a34c807d23c139e10 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Tue, 24 Feb 2026 10:07:17 +0100 Subject: [PATCH] pinwheel: Move workspaces to monitor on hotplug Workspace rules alone only affect future workspace creation. Add moveworkspacetomonitor dispatches so existing workspaces are moved to the correct monitor when an external display is connected. --- hosts/pinwheel/modules/hyprland/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hosts/pinwheel/modules/hyprland/default.nix b/hosts/pinwheel/modules/hyprland/default.nix index 98733fe..ed951d3 100644 --- a/hosts/pinwheel/modules/hyprland/default.nix +++ b/hosts/pinwheel/modules/hyprland/default.nix @@ -32,14 +32,17 @@ let # External monitor connected: 1-5 on external, 6-10 on internal for ws in 1 2 3 4 5; do $HYPRCTL keyword workspace "$ws, monitor:$external, default:true" + $HYPRCTL dispatch moveworkspacetomonitor "$ws $external" done for ws in 6 7 8 9 10; do $HYPRCTL keyword workspace "$ws, monitor:$INTERNAL, default:true" + $HYPRCTL dispatch moveworkspacetomonitor "$ws $INTERNAL" done else # No external monitor: all workspaces on internal for ws in 1 2 3 4 5 6 7 8 9 10; do $HYPRCTL keyword workspace "$ws, monitor:$INTERNAL, default:true" + $HYPRCTL dispatch moveworkspacetomonitor "$ws $INTERNAL" done fi } @@ -47,7 +50,7 @@ let handle_event() { case $1 in monitoradded*|monitorremoved*) - sleep 0.5 # Give monitor time to initialize + sleep 0.5 bind_workspaces ;; esac