#!/bin/bash
# Niri variant of ewwstart.sh — used when running the Niri compositor instead
# of Hyprland. Niri has no `hyprctl`, so monitor count comes from `niri msg`.
/usr/bin/eww daemon

GTK_THEME=cyberqueer

# Count outputs via niri msg; each output has a "Scale" line → one per monitor.
monitorsum=$(niri msg outputs | grep Scale | wc -l)
# Niri includes the primary output in the count but indexing is 0-based,
# so decrement by one before the loop.
monitorsum--
for i in $(seq 1 $monitorsum);
do
    # Convert 1-based loop index to 0-based monitor ID.
    declare -i curmon=$i-1
	/usr/bin/eww open bar --id bar$curmon --arg monitor=$curmon
done

#/usr/bin/eww open bar --id primary --arg monitor=0
