summaryrefslogtreecommitdiff
path: root/hypr-brightness
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2025-07-15 22:31:39 -0500
committerZachIR <zachir@librem.one>2025-07-15 22:31:39 -0500
commit38be649ab8b5a12b08e81d38e3ff5e7ea69e09e5 (patch)
tree83853cd2e2129a57244a22c16e21ab546bac3ffc /hypr-brightness
parent4da60aad75c6d8cc03423fa45620fb670d3c02bb (diff)
parent45b2f55aea9200ce7570b39a68de8287fdd72d94 (diff)
Merge branch 'master' of zachir.xyz:zachir/bin
Diffstat (limited to 'hypr-brightness')
-rwxr-xr-xhypr-brightness23
1 files changed, 23 insertions, 0 deletions
diff --git a/hypr-brightness b/hypr-brightness
new file mode 100755
index 0000000..538c63b
--- /dev/null
+++ b/hypr-brightness
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Copyright albertnis on GitHub, unlicensed
+
+# 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