diff --git a/scripts/workspaces.sh b/scripts/workspaces.sh index e7bdab8..325850e 100755 --- a/scripts/workspaces.sh +++ b/scripts/workspaces.sh @@ -20,12 +20,12 @@ if ! [[ $new_workspace =~ ^-?[0-9]+$ ]]; then exit 1 fi -while read -r i a f;do - workspace[$a]=$i +while read -r n a f;do + workspace[$a]=$n if [[ $f == true ]]; then - active=$i + active=$n fi -done < <(hyprctl monitors -j | jq -r '.[]|"\(.id) \(.activeWorkspace.id) \(.focused)"') +done < <(hyprctl monitors -j | jq -r '.[]|"\(.name) \(.activeWorkspace.id) \(.focused)"') if [[ ${workspace[$new_workspace]} ]]; then hyprctl dispatch swapactiveworkspaces $active ${workspace[$new_workspace]}