From 1d364fc9886c59c398d4ddb1c3c36eaf4f0ca30e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 24 Jun 2026 13:52:37 +0200 Subject: [PATCH] Simplify brightness no-osd parsing --- bin/omarchy-brightness-display-apple | 15 ++++----------- bin/omarchy-brightness-keyboard | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/bin/omarchy-brightness-display-apple b/bin/omarchy-brightness-display-apple index 3e0d5c8b..81202b87 100755 --- a/bin/omarchy-brightness-display-apple +++ b/bin/omarchy-brightness-display-apple @@ -6,17 +6,10 @@ 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[@]}" +if [[ ${1:-} == "--no-osd" ]]; then + no_osd=1 + shift +fi detect_apple_display_device() { local devices=() diff --git a/bin/omarchy-brightness-keyboard b/bin/omarchy-brightness-keyboard index 318c6b1b..f323b94f 100755 --- a/bin/omarchy-brightness-keyboard +++ b/bin/omarchy-brightness-keyboard @@ -4,17 +4,10 @@ # omarchy:args=[--no-osd] no_osd=0 -args=() - -for arg in "$@"; do - if [[ $arg == "--no-osd" ]]; then - no_osd=1 - else - args+=("$arg") - fi -done - -set -- "${args[@]}" +if [[ ${1:-} == "--no-osd" ]]; then + no_osd=1 + shift +fi direction="${1:-up}"