diff --git a/hosts/pinwheel/modules/hyprland/default.nix b/hosts/pinwheel/modules/hyprland/default.nix index d8d5940..98aaed7 100644 --- a/hosts/pinwheel/modules/hyprland/default.nix +++ b/hosts/pinwheel/modules/hyprland/default.nix @@ -26,25 +26,27 @@ let } bind_workspaces() { - local external + local external batch="" if external=$(get_active_external); then # 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" + batch="$batch keyword workspace $ws,monitor:$external,default:true;" + batch="$batch 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" + batch="$batch keyword workspace $ws,monitor:$INTERNAL,default:true;" + batch="$batch 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" + batch="$batch keyword workspace $ws,monitor:$INTERNAL,default:true;" + batch="$batch dispatch moveworkspacetomonitor $ws $INTERNAL;" done fi + + $HYPRCTL --batch "$batch" } handle_event() {