#!/bin/bash

# Toggle the internal laptop display on/off.

if omarchy-hyprland-toggle-disabled internal-monitor-disable; then
  ACTIVE_COUNT=$(hyprctl monitors -j | jq 'length')
  if [[ $ACTIVE_COUNT -le 1 ]]; then
    notify-send -u low "󰍹    Can't disable the only active display"
    exit 1
  fi
fi

omarchy-hyprland-toggle \
  --enabled-notification "󰍹    Internal display off" \
  --disabled-notification "󰍹    Internal display on" \
  internal-monitor-disable
