From 9b85f9edd56193c01ea53379567c02bd614ae31c Mon Sep 17 00:00:00 2001 From: kenji Date: Thu, 7 May 2026 11:45:52 -0500 Subject: [PATCH] upd --- apps/hyprland/scripts/workspace-toggle.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/hyprland/scripts/workspace-toggle.nix b/apps/hyprland/scripts/workspace-toggle.nix index a2ae0e2..bd0f2dc 100644 --- a/apps/hyprland/scripts/workspace-toggle.nix +++ b/apps/hyprland/scripts/workspace-toggle.nix @@ -4,17 +4,18 @@ target_workspace="$1" # Get current workspace info - current=$(${pkgs.hyprland}/bin/hyprctl activeworkspace -j | ${pkgs.jq}/bin/jq -r '.id') + current_info=$(${pkgs.hyprland}/bin/hyprctl activeworkspace -j) + current=$(echo "$current_info" | ${pkgs.jq}/bin/jq -r '.id') # Check if we're in a special workspace (negative ID) if [[ $current -lt 0 ]]; then - # We're in a special workspace, switch to target workspace using split:workspace - ${pkgs.hyprland}/bin/hyprctl dispatch split:workspace "$target_workspace" + # We're in a special workspace, force switch to target workspace + ${pkgs.hyprland}/bin/hyprctl dispatch focusworkspaceoncurrentmonitor "$target_workspace" elif [[ $current -eq $target_workspace ]]; then # We're already on the target workspace, toggle back to previous ${pkgs.hyprland}/bin/hyprctl dispatch workspace previous else - # We're on a different workspace, switch to target using split:workspace + # We're on a different normal workspace, switch to target using split:workspace ${pkgs.hyprland}/bin/hyprctl dispatch split:workspace "$target_workspace" fi '';