#!/bin/bash count_moved = 0 while true; do result=$(hyprctl dispatch movetoworkspace e+0,tag:marked) if [ "$result" != "Window not found" ]; then echo "moved window because '$result'" result=$(hyprctl dispatch tagwindow -- -marked tag:marked) echo "tried umarking and was told $result" ((count_closed++)) else echo "exiting due to '$result'" break fi done