From ba202af9c79064e888c3336df205f42d9b29a4b8 Mon Sep 17 00:00:00 2001 From: zachir Date: Tue, 15 Jul 2025 17:58:58 -0500 Subject: Add hypr-brightness script for monitors --- hypr-brightness | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 hypr-brightness (limited to 'hypr-brightness') diff --git a/hypr-brightness b/hypr-brightness new file mode 100755 index 0000000..71e1e52 --- /dev/null +++ b/hypr-brightness @@ -0,0 +1,22 @@ +#!/bin/bash + +# Accept an arg '+' or '-' +direction=$1 + +# Get monitor info +monitor_data=$(hyprctl monitors -j) +focused_name=$(echo $monitor_data | jq -r '.[] | select(.focused == true) | .name') + +if [ "$focused_name" == "eDP-1" ]; then + # Internal display is focused -> use brillo + if [ "$direction" == "-" ]; then + brillo -u 150000 -U 5 + else + brillo -u 150000 -A 5 + fi +else + # External display is focused -> use ddcutil + # But *which* external display? + focused_id=$(echo $monitor_data | jq -r '.[] | select(.focused == true) | .id') + ddcutil --display=$focused_id setvcp 10 $direction 5 +fi -- cgit v1.2.3