changed workspaces.sh to use window name instead of id

This commit is contained in:
willifan 2024-06-03 22:03:20 +02:00
parent 02426e41e6
commit 1a6e0f68f7

View file

@ -20,12 +20,12 @@ if ! [[ $new_workspace =~ ^-?[0-9]+$ ]]; then
exit 1 exit 1
fi fi
while read -r i a f;do while read -r n a f;do
workspace[$a]=$i workspace[$a]=$n
if [[ $f == true ]]; then if [[ $f == true ]]; then
active=$i active=$n
fi 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 if [[ ${workspace[$new_workspace]} ]]; then
hyprctl dispatch swapactiveworkspaces $active ${workspace[$new_workspace]} hyprctl dispatch swapactiveworkspaces $active ${workspace[$new_workspace]}