#!/bin/sh
monitor=$1
state=$(hyprctl monitors all -j | jq -r ".[] | select(.name == \"$monitor\") | .disabled")
if [ $state == "true" ]; then
    hyprctl keyword monitor $monitor,preferred
else
    hyprctl keyword monitor $monitor,disable
fi