#!/bin/bash

count_closed = 0

while true; do
  result=$(hyprctl dispatch closewindow tag:marked)

  if [ "$result" != "closeWindow: no window found" ]; then
    echo "closed window because '$result'"
    ((count_closed++))
  else
    echo "exiting due to '$result'"
    break
  fi
done
