From 0daa3970611d260760a2d91957710c223d4beb1b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 22 Jul 2026 15:31:01 -0700 Subject: [PATCH] Remove redundant default command checks --- bin/omarchy-display-text-size | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bin/omarchy-display-text-size b/bin/omarchy-display-text-size index f2668ac6..90c259a8 100755 --- a/bin/omarchy-display-text-size +++ b/bin/omarchy-display-text-size @@ -103,7 +103,6 @@ reset_base_size() { # ---- GTK text-scaling-factor ---- set_factor() { - command -v gsettings >/dev/null 2>&1 || return 0 gsettings set "$GKEY_SCHEMA" "$GKEY_NAME" "$1" 2>/dev/null || true } @@ -141,7 +140,7 @@ set_terminal_size() { # size until relaunched (new windows pick up the change). Nudge the user — # but reuse the same notification id (freedesktop replaces_id) so dragging # through several sizes refreshes one toast instead of stacking a pile. - if command -v omarchy-notification-send >/dev/null 2>&1 && pgrep -x foot >/dev/null 2>&1; then + if pgrep -x foot >/dev/null 2>&1; then local id_file="${XDG_RUNTIME_DIR:-/tmp}/omarchy-display-text-size.foot-notif-id" local prev_id="" [[ -f $id_file ]] && read -r prev_id <"$id_file" 2>/dev/null @@ -177,11 +176,7 @@ case "${1:-}" in "") cur="$(current_base_size)" size="${cur:-12 (default)}" - if command -v gsettings >/dev/null 2>&1; then - factor="$(gsettings get "$GKEY_SCHEMA" "$GKEY_NAME" 2>/dev/null)" - else - factor="n/a (gsettings not installed)" - fi + factor="$(gsettings get "$GKEY_SCHEMA" "$GKEY_NAME" 2>/dev/null)" term="$(term_current_pt)" printf 'text size: %s px\ngtk text-scaling-factor: %s\nterminal font: %s pt\n' \ "$size" "$factor" "${term:-n/a}" @@ -189,9 +184,7 @@ case "${1:-}" in ;; reset | default) reset_base_size - if command -v gsettings >/dev/null 2>&1; then - gsettings reset "$GKEY_SCHEMA" "$GKEY_NAME" 2>/dev/null || true - fi + gsettings reset "$GKEY_SCHEMA" "$GKEY_NAME" 2>/dev/null || true set_terminal_size "$TERM_DEFAULT_PT" exit 0 ;;