#!/usr/bin/bash

scripts/overview --row 1

if [ "$1" == "--once" ]; then
  exit 0
else
  socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | rg --line-buffered "window>>" | while read -r line; do
    # This sleep is necessary
    # It prevents the script from being faster than hyprctl
    sleep 0.025
    scripts/overview --row 1
  done
fi