Suppress brightness OSD from display panel
This commit is contained in:
@@ -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")"
|
||||
|
||||
Reference in New Issue
Block a user