#!/bin/bash

for display in $(hyprctl -j monitors | jq -r 'map("\(.id)\n") | add'); do
  id="bar-${display}"

  if eww active-windows | grep "${id}"; then
    eww close "${id}"
    continue
  fi

  eww open bar --id "${id}" --arg monitor="${display}"

done
