From 328a9c007a630c6bddebaa0614badbd49771aea9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 21 May 2026 16:00:03 +0200 Subject: [PATCH] Style --- bin/omarchy-brightness-display | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-brightness-display b/bin/omarchy-brightness-display index d9c43904..06e0842b 100755 --- a/bin/omarchy-brightness-display +++ b/bin/omarchy-brightness-display @@ -4,13 +4,12 @@ # omarchy:args=[+N%|N%-|N%|off|on] # omarchy:examples=omarchy brightness display | omarchy brightness display +5% | omarchy brightness display 5%- | omarchy brightness display 50% | omarchy brightness display off | omarchy brightness display on +# Get the brightness of the passed display display_brightness() { - local device="$1" - - brightnessctl -d "$device" -m 2>/dev/null | awk -F, '{ gsub("%", "", $4); print $4; found=1 } END{ exit !found }' + brightnessctl -d "$1" -m 2>/dev/null | awk -F, '{ gsub("%", "", $4); print $4; found=1 } END{ exit !found }' } -if (( $# == 0 )) || [[ ${1:-} == "get" ]]; then +if (( $# == 0 )); then if omarchy-hyprland-monitor-focused-apple; then omarchy-brightness-display-apple exit @@ -41,6 +40,7 @@ if omarchy-hyprland-monitor-focused-apple; then exit fi +# Current device highlighted device="$(omarchy-hw-display)" || exit 1 # Current brightness percentage @@ -70,4 +70,6 @@ fi # Set brightness of the display device. brightnessctl -d "$device" set "$step" >/dev/null + +# Show the new brightness in OSD omarchy-osd -i brightness -p "$(display_brightness "$device")"