diff options
Diffstat (limited to 'hypr-brightness')
-rwxr-xr-x | hypr-brightness | 22 |
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 |