#!/usr/bin/env bash

# omarchy:summary=Return success if the focused or named Hyprland monitor is an Apple display.
# omarchy:args=[monitor]


"${BASH_SOURCE[0]%/*}/omarchy-on-hyprland" || exit 1

monitor="${1:-}"

hyprctl monitors -j | jq -e --arg monitor "$monitor" '
  .[]
  | select(if $monitor == "" then .focused == true else .name == $monitor end)
  | select(.make == "Apple Computer Inc" and (.model | test("StudioDisplay|ProDisplayXDR|Studio XDR")))
' >/dev/null
