#!/bin/bash

# omarchy:summary=Get brightness for the most likely display device.
# omarchy:examples=omarchy-brightness-display-get

if omarchy-hyprland-monitor-focused-apple; then
  omarchy-brightness-display-apple-get
else
  brightnessctl -d "$(omarchy-hw-display)" -m 2>/dev/null | awk -F, '{ gsub("%", "", $4); print $4; found=1 } END{ exit !found }'
fi
