From fed2298235044180fdde6c177666a0995895568c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 21 May 2026 19:30:30 +0200 Subject: [PATCH] Consistency --- bin/omarchy-battery-status | 2 +- bin/omarchy-dev-ui-preview | 2 +- bin/omarchy-hw-external-monitors | 4 ++-- bin/omarchy-install-gaming-battlenet | 2 +- bin/omarchy-install-gaming-gpu-lib32 | 2 +- bin/omarchy-launch-battlenet | 2 +- bin/omarchy-menu-images | 4 ++-- bin/omarchy-plymouth-preview | 2 +- bin/omarchy-plymouth-set | 2 +- bin/omarchy-plymouth-set-by-theme | 2 +- bin/omarchy-remove-browser | 2 +- bin/omarchy-shell | 4 ++-- bin/omarchy-theme-bg-set | 2 +- bin/omarchy-transcode | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/omarchy-battery-status b/bin/omarchy-battery-status index f43c75ed..ad0e1cbb 100755 --- a/bin/omarchy-battery-status +++ b/bin/omarchy-battery-status @@ -44,7 +44,7 @@ if [[ $shell_output == "true" ]]; then start=$(cat /sys/class/power_supply/BAT*/charge_control_start_threshold 2>/dev/null | head -1) if [[ -n $end ]]; then - if [[ -n $start && $start != "$end" ]]; then + if [[ -n $start && $start != $end ]]; then printf 'threshold\t%s-%s%%\n' "$start" "$end" else printf 'threshold\t%s%%\n' "$end" diff --git a/bin/omarchy-dev-ui-preview b/bin/omarchy-dev-ui-preview index 20c1d133..17ed2579 100755 --- a/bin/omarchy-dev-ui-preview +++ b/bin/omarchy-dev-ui-preview @@ -10,7 +10,7 @@ # `cursor-surface`, `slider`, `toggle`, `dropdown`, etc. Unknown names # are ignored and the gallery opens at its normal default position. -if [[ $# -gt 0 && -n $1 ]]; then +if (( $# > 0 )) && [[ -n $1 ]]; then section="$1" payload=$(printf '{"section":"%s"}' "${section//\"/}") else diff --git a/bin/omarchy-hw-external-monitors b/bin/omarchy-hw-external-monitors index 08ab52ff..3a5a837f 100755 --- a/bin/omarchy-hw-external-monitors +++ b/bin/omarchy-hw-external-monitors @@ -3,7 +3,7 @@ # omarchy:summary=Returns true when an external monitor is physically connected. for status in /sys/class/drm/card*-*/status; do - [[ "$status" == *-eDP-*/status ]] && continue - [[ "$(<"$status")" == "connected" ]] && exit 0 + [[ $status == *-eDP-*/status ]] && continue + [[ $(< $status) == "connected" ]] && exit 0 done exit 1 diff --git a/bin/omarchy-install-gaming-battlenet b/bin/omarchy-install-gaming-battlenet index 6283b3dc..94a01e63 100755 --- a/bin/omarchy-install-gaming-battlenet +++ b/bin/omarchy-install-gaming-battlenet @@ -37,7 +37,7 @@ export PROTONPATH=GE-Proton export GAMEID=umu-battlenet export PROTON_VERB=run -if [[ -f "$LAUNCHER" ]]; then +if [[ -f $LAUNCHER ]]; then echo "Battle.net is already installed at $PREFIX." launched_installer=0 else diff --git a/bin/omarchy-install-gaming-gpu-lib32 b/bin/omarchy-install-gaming-gpu-lib32 index 419c44e0..fadfa7dc 100755 --- a/bin/omarchy-install-gaming-gpu-lib32 +++ b/bin/omarchy-install-gaming-gpu-lib32 @@ -25,4 +25,4 @@ elif omarchy-hw-nvidia-without-gsp; then PACKAGES+=(lib32-nvidia-580xx-utils) fi -[[ ${#PACKAGES[@]} -gt 0 ]] && omarchy-pkg-add "${PACKAGES[@]}" +(( ${#PACKAGES[@]} > 0 )) && omarchy-pkg-add "${PACKAGES[@]}" diff --git a/bin/omarchy-launch-battlenet b/bin/omarchy-launch-battlenet index d7f566eb..abaa85e5 100755 --- a/bin/omarchy-launch-battlenet +++ b/bin/omarchy-launch-battlenet @@ -32,7 +32,7 @@ EOF esac done -if [[ ! -f "$LAUNCHER" ]]; then +if [[ ! -f $LAUNCHER ]]; then echo "Battle.net is not installed. Run omarchy-install-gaming-battlenet first." >&2 exit 1 fi diff --git a/bin/omarchy-menu-images b/bin/omarchy-menu-images index 8af5948f..5c6ede58 100755 --- a/bin/omarchy-menu-images +++ b/bin/omarchy-menu-images @@ -17,7 +17,7 @@ usage() { echo "Usage: omarchy-menu-images [--selected ] [--print-name] [--show-labels] [--filterable] [--lazy-thumbnails] [--preload] [--cache-only] ..." } -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do case "$1" in --selected) if (( $# < 2 )); then @@ -199,7 +199,7 @@ elif [[ $rows_cache_hit != true ]]; then for image in "${image_files[@]}"; do thumbnail=$(thumbnail_for "$image") [[ -n $thumbnail ]] || continue - if [[ $lazy_thumbnails == true && $cache_only != true && $thumbnail == "$image" ]]; then + if [[ $lazy_thumbnails == true && $cache_only != true && $thumbnail == $image ]]; then rows_cacheable=false fi diff --git a/bin/omarchy-plymouth-preview b/bin/omarchy-plymouth-preview index b3724f5a..981d07d6 100755 --- a/bin/omarchy-plymouth-preview +++ b/bin/omarchy-plymouth-preview @@ -7,7 +7,7 @@ # Render a Plymouth login-screen preview PNG by compositing the staged omarchy # theme assets (recolored with the given text color) onto the background. -if [[ $# -ne 4 ]]; then +if (( $# != 4 )); then echo "Usage: omarchy-plymouth-preview " >&2 exit 1 fi diff --git a/bin/omarchy-plymouth-set b/bin/omarchy-plymouth-set index c92ca53c..6420266c 100755 --- a/bin/omarchy-plymouth-set +++ b/bin/omarchy-plymouth-set @@ -10,7 +10,7 @@ # rebuilds the initramfs. Also syncs the SDDM login screen (the post-logout # screen) with the same colors and logo so boot/login stay visually unified. -if [[ $# -ne 3 ]]; then +if (( $# != 3 )); then echo "Usage: omarchy-plymouth-set " >&2 exit 1 fi diff --git a/bin/omarchy-plymouth-set-by-theme b/bin/omarchy-plymouth-set-by-theme index d46d5668..52ae33f7 100755 --- a/bin/omarchy-plymouth-set-by-theme +++ b/bin/omarchy-plymouth-set-by-theme @@ -7,7 +7,7 @@ # Resolve a theme by name and apply its unlock.png + colors.toml as the # Plymouth boot screen via omarchy-plymouth-set. -if [[ $# -ne 1 ]]; then +if (( $# != 1 )); then echo "Usage: omarchy-plymouth-set-by-theme " >&2 exit 1 fi diff --git a/bin/omarchy-remove-browser b/bin/omarchy-remove-browser index 6ae076df..b459d6ae 100755 --- a/bin/omarchy-remove-browser +++ b/bin/omarchy-remove-browser @@ -9,7 +9,7 @@ set_fallback_default_browser() { local current_browser current_browser=$(xdg-settings get default-web-browser) - if [[ $current_browser != "$1" ]]; then + if [[ $current_browser != $1 ]]; then return fi diff --git a/bin/omarchy-shell b/bin/omarchy-shell index 29e870f1..1917df27 100755 --- a/bin/omarchy-shell +++ b/bin/omarchy-shell @@ -10,7 +10,7 @@ if [[ ${1:-} == "-q" ]]; then shift fi -if [[ $# -eq 0 || $1 == "-h" || $1 == "--help" ]]; then +if (( $# == 0 )) || [[ $1 == "-h" || $1 == "--help" ]]; then cat < [args...] @@ -45,7 +45,7 @@ fi SHELL_QML="$OMARCHY_PATH/shell/shell.qml" -if [[ $1 == "shell" && ( $2 == "summon" || $2 == "toggle" ) && $# -eq 3 ]]; then +if [[ $1 == "shell" && ( $2 == "summon" || $2 == "toggle" ) ]] && (( $# == 3 )); then set -- "$1" "$2" "$3" "{}" fi diff --git a/bin/omarchy-theme-bg-set b/bin/omarchy-theme-bg-set index 4ecd069b..94da61f9 100755 --- a/bin/omarchy-theme-bg-set +++ b/bin/omarchy-theme-bg-set @@ -12,7 +12,7 @@ fi BACKGROUND="$(realpath "$1")" CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background" -if [[ ! -f "$BACKGROUND" ]]; then +if [[ ! -f $BACKGROUND ]]; then echo "File does not exist: $BACKGROUND" >&2 exit 1 fi diff --git a/bin/omarchy-transcode b/bin/omarchy-transcode index 4ed6fcf1..3a6acfd1 100755 --- a/bin/omarchy-transcode +++ b/bin/omarchy-transcode @@ -136,7 +136,7 @@ main() { case "$1" in --path) shift - [[ $# -gt 0 ]] || { echo "Missing value for --path" >&2; return 2; } + (( $# > 0 )) || { echo "Missing value for --path" >&2; return 2; } search_path="$1" ;; --help | -h)