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
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]}