From f6d5df5a892d29fddebaa73828930f05763e774a Mon Sep 17 00:00:00 2001 From: Maximiliano Guzenski Date: Sat, 9 Aug 2025 14:34:01 -0300 Subject: [PATCH] Package manager usability improvements (#569) * better pkg manager with shotcuts * removed ctrl-d, it conflict with terminal * reveal keybinds to user * We don't need yayf any more now we have full integration in Omarchy menu --------- Co-authored-by: David Heinemeier Hansson --- bin/omarchy-pkg-install | 11 ++++++++++- bin/omarchy-pkg-remove | 11 ++++++++++- default/bash/aliases | 3 --- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-pkg-install b/bin/omarchy-pkg-install index b407e35c..072bb81e 100755 --- a/bin/omarchy-pkg-install +++ b/bin/omarchy-pkg-install @@ -1,6 +1,15 @@ #!/bin/bash -pkg_name=$(yay -Slq | fzf --multi --preview 'yay -Sii {1}' --preview-window=down:75%) +fzf_args=( + --multi + --preview 'echo "alt-p: toggle preview, alt-j/k: scroll, F11: maxime"; echo; yay -Sii {1}' + --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' +) + +pkg_name=$(yay -Slq | fzf "${fzf_args[@]}") if [[ -n "$pkg_name" ]]; then yay -Sy --noconfirm "$pkg_name" diff --git a/bin/omarchy-pkg-remove b/bin/omarchy-pkg-remove index c9286c2e..31e51173 100755 --- a/bin/omarchy-pkg-remove +++ b/bin/omarchy-pkg-remove @@ -1,6 +1,15 @@ #!/bin/bash -pkg_name=$(yay -Qqe | fzf --multi --preview 'yay -Qi {1}' --preview-window=down:75%) +fzf_args=( + --multi + --preview 'echo "alt-p: toggle preview, alt-j/k: scroll, F11: maxime"; echo; yay -Qi {1}' + --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' +) + +pkg_name=$(yay -Qqe | fzf "${fzf_args[@]}") if [[ -n "$pkg_name" ]]; then yay -Rns --noconfirm "$pkg_name" diff --git a/default/bash/aliases b/default/bash/aliases index c5a40ae8..7ec9036e 100644 --- a/default/bash/aliases +++ b/default/bash/aliases @@ -33,6 +33,3 @@ n() { if [ "$#" -eq 0 ]; then nvim .; else nvim "$@"; fi; } alias gcm='git commit -m' alias gcam='git commit -a -m' alias gcad='git commit -a --amend' - -# Find packages without leaving the terminal -alias yayf="yay -Slq | fzf --multi --preview 'yay -Sii {1}' --preview-window=down:75% | xargs -ro yay -S"