From a87ba131578236b2c071ed1bfe7591baf6e4e57f Mon Sep 17 00:00:00 2001 From: bretello Date: Mon, 12 Aug 2024 17:40:19 +0200 Subject: [PATCH] zsh: functions: add paclocfile to show information about the package owning a file --- functions/pacman.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functions/pacman.zsh b/functions/pacman.zsh index bd7c116..2f54ea9 100644 --- a/functions/pacman.zsh +++ b/functions/pacman.zsh @@ -7,3 +7,13 @@ function pacpreview() { fi pacman -Slq | fzf --multi --preview 'grc --colour=on pacman -Si {1}' | xargs -ro sudo pacman -S } + + +function paclocfile() { + if [[ -z $1 ]]; then + echo "Usage: paclocfile /path/to/file" >&2 + echo "Shows information about the package owning the given file" >&2 + return 1 + fi + pacman -Qi $(pacman -Qo /etc/containers/registries.conf | awk '{print $5}') +}