From dc57d1881bfddf68d6be32375233c4c9c0e6793c Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Sun, 15 Apr 2018 19:13:39 +0200 Subject: [PATCH] plugins/archlinux: add pacls, pacown, pacweb --- plugins/archlinux/archlinux.plugin.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 79cc6ed11..ae80eb9f0 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -117,6 +117,8 @@ alias paclsorphans='sudo pacman -Qdt' alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' alias pacfileupg='sudo pacman -Fy' alias pacfiles='pacman -Fs' +alias pacls='pacman -Ql' +alias pacown='pacman -Qo' if (( $+commands[abs] && $+commands[aur] )); then @@ -169,3 +171,16 @@ function pacmansignkeys() { --no-permission-warning --command-fd 0 --edit-key $key done } + +if (( $+commands[xdg-open] )); then + function pacweb() { + pkg="$1" + infos="$(pacman -Si "$pkg")" + if [[ -z "$infos" ]]; then + return + fi + repo="$(grep '^Repo' <<< "$infos" | grep -oP '[^ ]+$')" + arch="$(grep '^Arch' <<< "$infos" | grep -oP '[^ ]+$')" + xdg-open "https://www.archlinux.org/packages/$repo/$arch/$pkg/" &>/dev/null + } +fi