diff --git a/bin/omarchy-bar b/bin/omarchy-bar index c0bca1b3..36c62092 100755 --- a/bin/omarchy-bar +++ b/bin/omarchy-bar @@ -43,7 +43,7 @@ bar_option_exists() { cmd_use() { local plugin="${1:-}" [[ -n $plugin ]] || fail "bar option id is required" - [[ $# -eq 1 ]] || fail "use takes a single bar option id" + (( $# == 1 )) || fail "use takes a single bar option id" if [[ $plugin == "default" || $plugin == "built-in" ]]; then plugin="omarchy.bar" fi @@ -74,7 +74,7 @@ cmd_defaults() { cmd_position() { local position="${1:-}" [[ -n $position ]] || fail "position is required" - [[ $# -eq 1 ]] || fail "position takes a single value" + (( $# == 1 )) || fail "position takes a single value" [[ $position =~ ^(top|bottom|left|right)$ ]] || fail "position must be top, bottom, left, or right" commit "$NORMALIZE | .bar.position = \$position" --arg position "$position" echo "Bar position set to $position" @@ -83,7 +83,7 @@ cmd_position() { cmd_transparent() { local transparent="${1:-}" [[ -n $transparent ]] || fail "transparent is required" - [[ $# -eq 1 ]] || fail "transparent takes a single value" + (( $# == 1 )) || fail "transparent takes a single value" [[ $transparent =~ ^(true|false|toggle)$ ]] || fail "transparent must be true, false, or toggle" if [[ $transparent == "toggle" ]]; then commit "$NORMALIZE | .bar.transparent = (.bar.transparent != true)" @@ -97,7 +97,7 @@ cmd_transparent() { # --------------------------------------------------------------------- dispatch command="${1:-}" -[[ $# -gt 0 ]] && shift || true +(( $# > 0 )) && shift || true case "$command" in use) diff --git a/bin/omarchy-bar-plugin b/bin/omarchy-bar-plugin index 864f663a..9e0d829c 100755 --- a/bin/omarchy-bar-plugin +++ b/bin/omarchy-bar-plugin @@ -416,7 +416,7 @@ cmd_replace() { local new="${2:-}" [[ -n $old ]] || fail "replace requires the source widget id" [[ -n $new ]] || fail "replace requires the replacement widget id" - [[ $# -eq 2 ]] || fail "replace takes two widget ids" + (( $# == 2 )) || fail "replace takes two widget ids" local prog prog=$(cat < 0 )) && shift || true case "$command" in add) diff --git a/bin/omarchy-clipboard-open b/bin/omarchy-clipboard-open index c4d08709..98f26bb2 100755 --- a/bin/omarchy-clipboard-open +++ b/bin/omarchy-clipboard-open @@ -8,7 +8,7 @@ history_index="" history_path="$HOME/.local/state/omarchy/clipboard-history.json" -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do case "$1" in --history-index) history_index="${2:-}" diff --git a/bin/omarchy-clipboard-paste-text b/bin/omarchy-clipboard-paste-text index ac0781a6..b8ac8e31 100755 --- a/bin/omarchy-clipboard-paste-text +++ b/bin/omarchy-clipboard-paste-text @@ -11,7 +11,7 @@ copy_only=false history_index="" text="" -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do case "$1" in --shift-insert) use_shift_insert=true diff --git a/bin/omarchy-plugin b/bin/omarchy-plugin index 9955ce55..c7266fcb 100755 --- a/bin/omarchy-plugin +++ b/bin/omarchy-plugin @@ -151,7 +151,7 @@ plugin_enabled() { [[ -n $id ]] || fail "plugin id is required" shift 2 - if [[ $enabled != "true" && $# -gt 0 ]]; then + if [[ $enabled != "true" ]] && (( $# > 0 )); then fail "disable does not take placement options" fi @@ -165,7 +165,7 @@ plugin_enabled() { result=$(omarchy-shell shell setPluginEnabled "$id" "$enabled") || fail "could not update plugin; is omarchy-shell running?" [[ $result == "ok" ]] || fail "plugin '$id' is not known; run: omarchy plugin rescan" - if [[ $enabled == "true" && $# -gt 0 ]]; then + if [[ $enabled == "true" ]] && (( $# > 0 )); then omarchy-bar-plugin move "$id" "$@" echo "Enabled and moved $id" elif [[ $enabled == "true" ]]; then diff --git a/bin/omarchy-setup-security-sshd b/bin/omarchy-setup-security-sshd index 907bc021..781cd1b9 100755 --- a/bin/omarchy-setup-security-sshd +++ b/bin/omarchy-setup-security-sshd @@ -89,7 +89,7 @@ authorize_keys_from_github() { authorize_key "$key" && added=$((added + 1)) done <<<"$keys" - if [[ $added -eq 0 ]]; then + if (( added == 0 )); then echo -e "\e[31mNo valid SSH keys found for GitHub user '$username'.\e[0m" >&2 exit 1 fi diff --git a/bin/omarchy-theme-color b/bin/omarchy-theme-color index b4491f06..cbbab0e2 100755 --- a/bin/omarchy-theme-color +++ b/bin/omarchy-theme-color @@ -26,7 +26,7 @@ usage() { echo "Usage: omarchy-theme-color [--file ] (--all | --raw | [fallback])" } -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do case "$1" in --file) COLORS_FILE="${2:-}"