Stop checking for commands the package set guarantees

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) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-10 03:31:17 -07:00
co-authored by Claude Opus 5
parent 4564c24a0e
commit f228c4d390
2 changed files with 18 additions and 22 deletions
-3
View File
@@ -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. # font, i.e. a no-op. All three fonts ship with kbd, so there's no dependency.
scale_console_font() { scale_console_font() {
[[ $(tty 2>/dev/null) == /dev/tty* ]] || return 0 [[ $(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 # 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 # fbcon actually hands back, and keep the one whose row count lands nearest a
@@ -472,7 +471,6 @@ greeter_screen() {
# --reuse-canvas paints upward from the saved cursor, anchored one row below # --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 # the logo to repaint exactly the rows drawn above. --canvas-width is cols-1
# to stay off the autowrap column. # 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))" printf '%s%d;1H\0337' "$CSI" "$((logo_row + LOGO_HEIGHT))"
# Run ttfx directly (not inside a `while` subshell) so $anim is ttfx's own # 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 # PID: killing a wrapping subshell would orphan ttfx, which then keeps
@@ -490,7 +488,6 @@ greeter_screen() {
--final-gradient-stops 2 \ --final-gradient-stops 2 \
</dev/null >/dev/tty 2>/dev/null & </dev/null >/dev/tty 2>/dev/null &
anim=$! anim=$!
fi
} }
_greeter_kill_anim() { _greeter_kill_anim() {
+1 -2
View File
@@ -433,8 +433,7 @@ rollback_degraded_rekey() {
} }
main() { main() {
command -v gum >/dev/null || { echo "Error: gum is required" >&2; exit 1; } omarchy-cmd-present btrfs || { echo "Error: btrfs-progs is required" >&2; exit 1; }
command -v btrfs >/dev/null || { echo "Error: btrfs-progs is required" >&2; exit 1; }
root_is_btrfs_at || fail "reset requires the standard Omarchy Btrfs layout (subvol=@)" root_is_btrfs_at || fail "reset requires the standard Omarchy Btrfs layout (subvol=@)"