From e034ed520e19be728a240df267306a0f73f19dcf Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:43:07 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(pkg):=20Search=20core/extra/AU?= =?UTF-8?q?R=20repos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auto-populates the command prompt with 'yay -S $selected_pkgs'. --- .config/fish/functions/pkgsearch.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .config/fish/functions/pkgsearch.fish diff --git a/.config/fish/functions/pkgsearch.fish b/.config/fish/functions/pkgsearch.fish new file mode 100644 index 0000000..dd6930e --- /dev/null +++ b/.config/fish/functions/pkgsearch.fish @@ -0,0 +1,12 @@ +#!/usr/bin/env fish + +function pkgsearch -d "Search the core/extra/AUR repos for a package" + set -f res (yay -Slq | command fzf --multi --preview 'yay -Si {}' --height=90% --layout=reverse) + + if test $status -eq 0 + set -l pkgs (string join ' ' $res) + commandline --current-token --replace -- "yay -S $res" + end + + commandline --function repaint +end