From f228c4d3900c021610773cbc5a8cef2da44b97da Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 10 Aug 2026 03:31:17 -0700 Subject: [PATCH] Stop checking for commands the package set guarantees MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gum and ttfx ship in omarchy-base.packages and setfont comes with kbd, so none of them needs a presence check — and every setfont call already tolerates a failure anyway. btrfs-progs is in omarchy-other.packages and a reset genuinely cannot proceed without it, so that one keeps its guard and moves to the helper. Co-Authored-By: Claude Opus 5 (1M context) --- bin/omarchy-provision-owner | 37 +++++++++++++++----------------- bin/omarchy-system-factory-reset | 3 +-- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/bin/omarchy-provision-owner b/bin/omarchy-provision-owner index 7b771038..7f8ab00e 100755 --- a/bin/omarchy-provision-owner +++ b/bin/omarchy-provision-owner @@ -67,7 +67,6 @@ export GUM_CONFIRM_UNSELECTED_BACKGROUND="0" # font, i.e. a no-op. All three fonts ship with kbd, so there's no dependency. scale_console_font() { [[ $(tty 2>/dev/null) == /dev/tty* ]] || return 0 - command -v setfont >/dev/null 2>&1 || return 0 # Pick the console font empirically: apply each candidate, read the columns # fbcon actually hands back, and keep the one whose row count lands nearest a @@ -472,25 +471,23 @@ greeter_screen() { # --reuse-canvas paints upward from the saved cursor, anchored one row below # the logo to repaint exactly the rows drawn above. --canvas-width is cols-1 # to stay off the autowrap column. - if command -v ttfx >/dev/null 2>&1; then - printf '%s%d;1H\0337' "$CSI" "$((logo_row + LOGO_HEIGHT))" - # Run ttfx directly (not inside a `while` subshell) so $anim is ttfx's own - # PID: killing a wrapping subshell would orphan ttfx, which then keeps - # painting the logo over the keyboard step. --cycles is high enough that it - # never ends on its own before Return. - ttfx -i "$LOGO_PATH" \ - --canvas-width "$((cols - 1))" \ - --anchor-text c \ - --frame-rate 60 \ - --reuse-canvas \ - colorshift \ - --gradient-stops 2 10 6 10 \ - --gradient-frames 3 \ - --cycles 1000 \ - --final-gradient-stops 2 \ - /dev/tty 2>/dev/null & - anim=$! - fi + printf '%s%d;1H\0337' "$CSI" "$((logo_row + LOGO_HEIGHT))" + # Run ttfx directly (not inside a `while` subshell) so $anim is ttfx's own + # PID: killing a wrapping subshell would orphan ttfx, which then keeps + # painting the logo over the keyboard step. --cycles is high enough that it + # never ends on its own before Return. + ttfx -i "$LOGO_PATH" \ + --canvas-width "$((cols - 1))" \ + --anchor-text c \ + --frame-rate 60 \ + --reuse-canvas \ + colorshift \ + --gradient-stops 2 10 6 10 \ + --gradient-frames 3 \ + --cycles 1000 \ + --final-gradient-stops 2 \ + /dev/tty 2>/dev/null & + anim=$! } _greeter_kill_anim() { diff --git a/bin/omarchy-system-factory-reset b/bin/omarchy-system-factory-reset index 7648663d..d7baf337 100755 --- a/bin/omarchy-system-factory-reset +++ b/bin/omarchy-system-factory-reset @@ -433,8 +433,7 @@ rollback_degraded_rekey() { } main() { - command -v gum >/dev/null || { echo "Error: gum is required" >&2; exit 1; } - command -v btrfs >/dev/null || { echo "Error: btrfs-progs is required" >&2; exit 1; } + omarchy-cmd-present btrfs || { echo "Error: btrfs-progs is required" >&2; exit 1; } root_is_btrfs_at || fail "reset requires the standard Omarchy Btrfs layout (subvol=@)"