Skip to content

Instantly share code, notes, and snippets.

@thingsiplay
Created March 25, 2024 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thingsiplay/7a25bb3d62845d1f0f88322a026e1b6b to your computer and use it in GitHub Desktop.
Save thingsiplay/7a25bb3d62845d1f0f88322a026e1b6b to your computer and use it in GitHub Desktop.
yay query preview
#!/bin/env bash
yay_preview() {
yay -Qqil "${1}"
}
export -f yay_preview
yay_preview_output() {
yay_preview "${1}" | less
echo "\$ yay -Qqi ${1}"
yay -Qqi "${1}"
}
export -f yay_preview_output
yay -Qq |
grep -E -- "${1}" |
fzf --preview 'yay_preview {}' \
--no-sort \
--reverse \
--border rounded \
--border-label ' [Query Packages] ' \
--bind 'enter:execute(yay_preview_output {})'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment