summaryrefslogtreecommitdiff
path: root/hypr-brightness
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2025-07-15 17:58:58 -0500
committerzachir <zachir@librem.one>2025-07-15 17:58:58 -0500
commitba202af9c79064e888c3336df205f42d9b29a4b8 (patch)
treee8724228517a073b0942ae011d4ed96df27021d3 /hypr-brightness
parent786ebe42d177e84c03fe146eb63f49b0d16a1366 (diff)
Add hypr-brightness script for monitors
Diffstat (limited to 'hypr-brightness')
-rwxr-xr-xhypr-brightness22
1 files changed, 22 insertions, 0 deletions
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