Files
omarchy/bin/omarchy-pkg-install
T
David Heinemeier HanssonandClaude Fable 5 bc0753dfcb Show a failure state when a presented command exits non-zero
The floating-terminal presentation wrapper showed the green "Done!"
prompt for every exit code except Ctrl-C, so a failed update or channel
switch closed looking like a success. Pass the command's exit code
through to omarchy-show-done and render a red "Failed (exit code N)!"
prompt when it is non-zero. The pkg install/remove pickers get the same
treatment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-13 10:21:46 +02:00

27 lines
799 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Show a fuzzy-finder TUI for picking new Arch and OPR packages to install.
# omarchy:requires-sudo=true
fzf_args=(
--multi
--preview 'pacman -Sii {1}'
--preview-label='alt-p: toggle description, alt-j/k: scroll, tab: multi-select'
--preview-label-pos='bottom'
--preview-window 'down:65%:wrap'
--bind 'alt-p:toggle-preview'
--bind 'alt-d:preview-half-page-down,alt-u:preview-half-page-up'
--bind 'alt-k:preview-up,alt-j:preview-down'
--color 'pointer:green,marker:green'
)
pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}")
if [[ -n $pkg_names ]]; then
source omarchy-sudo-keepalive
# Convert newline-separated selections to space-separated for pacman
echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm
omarchy-show-done $?
fi