Fix multi-package removal in package uninstaller (#822)
* Fix multi-package removal in omarchy-pkg-remove The script already had multi-selection enabled with --multi flag, but wasn't handling multiple selections correctly. When users selected multiple packages with Tab, they wouldn't all get removed. Fixed by using xargs to properly convert newline-separated package names from fzf into individual arguments for yay. Fixes #805 * Add multi-select explainer * Fix multi install like we did for remove --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
parent
53217c4c83
commit
4a1888af8f
@ -6,7 +6,7 @@ omarchy-ensure-aur-available
|
|||||||
fzf_args=(
|
fzf_args=(
|
||||||
--multi
|
--multi
|
||||||
--preview 'yay -Sii {1}'
|
--preview 'yay -Sii {1}'
|
||||||
--preview-label='alt-p: toggle description, alt-j/k: scroll, F11: maximize'
|
--preview-label='alt-p: toggle description, alt-j/k: scroll, tab: multi-select, F11: maximize'
|
||||||
--preview-label-pos='bottom'
|
--preview-label-pos='bottom'
|
||||||
--preview-window 'down:65%:wrap'
|
--preview-window 'down:65%:wrap'
|
||||||
--bind 'alt-p:toggle-preview'
|
--bind 'alt-p:toggle-preview'
|
||||||
@ -15,10 +15,11 @@ fzf_args=(
|
|||||||
--color 'pointer:green,marker:green'
|
--color 'pointer:green,marker:green'
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg_name=$(yay -Slq | fzf "${fzf_args[@]}")
|
pkg_names=$(yay -Slq | fzf "${fzf_args[@]}")
|
||||||
|
|
||||||
if [[ -n "$pkg_name" ]]; then
|
if [[ -n "$pkg_names" ]]; then
|
||||||
yay -Sy --noconfirm "$pkg_name"
|
# Convert newline-separated selections to space-separated for yay
|
||||||
|
echo "$pkg_names" | tr '\n' ' ' | xargs yay -Sy --noconfirm
|
||||||
sudo updatedb
|
sudo updatedb
|
||||||
omarchy-show-done
|
omarchy-show-done
|
||||||
fi
|
fi
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
fzf_args=(
|
fzf_args=(
|
||||||
--multi
|
--multi
|
||||||
--preview 'yay -Qi {1}'
|
--preview 'yay -Qi {1}'
|
||||||
--preview-label='alt-p: toggle description, alt-j/k: scroll, F11: maximize'
|
--preview-label='alt-p: toggle description, alt-j/k: scroll, tab: multi-select, F11: maximize'
|
||||||
--preview-label-pos='bottom'
|
--preview-label-pos='bottom'
|
||||||
--preview-window 'down:65%:wrap'
|
--preview-window 'down:65%:wrap'
|
||||||
--bind 'alt-p:toggle-preview'
|
--bind 'alt-p:toggle-preview'
|
||||||
@ -12,10 +12,11 @@ fzf_args=(
|
|||||||
--color 'pointer:red,marker:red'
|
--color 'pointer:red,marker:red'
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg_name=$(yay -Qqe | fzf "${fzf_args[@]}")
|
pkg_names=$(yay -Qqe | fzf "${fzf_args[@]}")
|
||||||
|
|
||||||
if [[ -n "$pkg_name" ]]; then
|
if [[ -n "$pkg_names" ]]; then
|
||||||
yay -Rns --noconfirm "$pkg_name"
|
# Convert newline-separated selections to space-separated for yay
|
||||||
|
echo "$pkg_names" | tr '\n' ' ' | xargs yay -Rns --noconfirm
|
||||||
sudo updatedb
|
sudo updatedb
|
||||||
omarchy-show-done
|
omarchy-show-done
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user