Suppress brightness OSD from display panel

This commit is contained in:
David Heinemeier Hansson
2026-05-22 11:35:36 +02:00
parent 7b6a03fa08
commit c522757acf
4 changed files with 52 additions and 10 deletions
+15 -3
View File
@@ -1,10 +1,22 @@
#!/bin/bash
# omarchy:summary=Show or adjust Apple Studio Display and Apple XDR Display brightness using asdcontrol.
# omarchy:args=[+N%|N%-|N%]
# omarchy:examples=omarchy brightness display apple | omarchy brightness display apple +5% | omarchy brightness display apple 5%- | omarchy brightness display apple 50%
# omarchy:args=[--no-osd] [+N%|N%-|N%]
# omarchy:examples=omarchy brightness display apple | omarchy brightness display apple +5% | omarchy brightness display apple --no-osd 50%
device_cache="${XDG_RUNTIME_DIR:-/tmp}/omarchy-brightness-display-apple.device"
no_osd=0
args=()
for arg in "$@"; do
if [[ $arg == "--no-osd" ]]; then
no_osd=1
else
args+=("$arg")
fi
done
set -- "${args[@]}"
detect_apple_display_device() {
local devices=()
@@ -86,4 +98,4 @@ if ! sudo asdcontrol "$device" -- "$step" >/dev/null; then
sudo asdcontrol "$device" -- "$step" >/dev/null
fi
omarchy-osd -i brightness -p "$(current_brightness "$device")"
(( no_osd )) || omarchy-osd -i brightness -p "$(current_brightness "$device")"