From 4287472e02e1b7462b7df9c65c35e92777fb4033 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 14 Jan 2026 17:11:50 -0500 Subject: [PATCH] Simplify --- bin/omarchy-cmd-brightness | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-cmd-brightness b/bin/omarchy-cmd-brightness index adcdacab..5db63dd2 100755 --- a/bin/omarchy-cmd-brightness +++ b/bin/omarchy-cmd-brightness @@ -17,13 +17,10 @@ done brightnessctl -d "$device" set "$step" >/dev/null # Use SwayOSD to display the new brightness setting. -current=$(brightnessctl -d "$device" g) -max=$(brightnessctl -d "$device" m) -percent=$(( current * 100 / max )) -progress=$(awk -v c="$current" -v m="$max" 'BEGIN{printf "%.2f", c/m}') +percent=$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%') swayosd-client \ --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \ --custom-icon display-brightness \ - --custom-progress "$progress" \ + --custom-progress "$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')" \ --custom-progress-text "${percent}%"