From 55604e43f570fa9be781e10d2e127fa55848ece9 Mon Sep 17 00:00:00 2001 From: Miha Rekar Date: Mon, 13 Oct 2025 01:57:52 +0200 Subject: [PATCH] Show overlay when changing display brightness (#2348) --- bin/omarchy-cmd-apple-display-brightness | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-cmd-apple-display-brightness b/bin/omarchy-cmd-apple-display-brightness index e611e8b7..7ba3d20a 100755 --- a/bin/omarchy-cmd-apple-display-brightness +++ b/bin/omarchy-cmd-apple-display-brightness @@ -3,5 +3,12 @@ if [[ $# -eq 0 ]]; then echo "Adjust Apple Display Brightness by passing +5000 or -5000 (or any range from 0-60000)" else - sudo asdcontrol $(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1) -- "$1" + DEVICE="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)" + sudo asdcontrol "$DEVICE" -- "$1" >/dev/null + VALUE="$(sudo asdcontrol "$DEVICE" | awk -F= '/BRIGHTNESS=/{print $2+0}')" + swayosd-client \ + --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \ + --custom-icon display-brightness \ + --custom-progress "$(awk -v v="$VALUE" 'BEGIN{printf "%.2f", v/60000}')" \ + --custom-progress-text "$(( VALUE * 100 / 60000 ))%" fi