mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
plugins/archlinux: add pacls, pacowns, pacweb
* `pacls`: list files in package * `pacowns`: which package owns a specific file * `pacweb`: goto package's Arch Linux webpage
This commit is contained in:
parent
598a9c6f99
commit
1b79cfd5c6
1 changed files with 21 additions and 0 deletions
|
|
@ -61,6 +61,27 @@ paclist() {
|
||||||
alias paclsorphans='sudo pacman -Qdt'
|
alias paclsorphans='sudo pacman -Qdt'
|
||||||
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
|
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
|
||||||
|
|
||||||
|
# list of files in package
|
||||||
|
alias pacls='pacman -Ql'
|
||||||
|
|
||||||
|
# who owns this file?
|
||||||
|
alias pacowns='pacman -Qo'
|
||||||
|
alias pacown='pacowns'
|
||||||
|
|
||||||
|
# goto package's Arch Linux webpage
|
||||||
|
if [[ -x "$(which xdg-open)" ]]; then
|
||||||
|
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/" 2>&1 >/dev/null &
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
pacdisowned() {
|
pacdisowned() {
|
||||||
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
|
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
|
||||||
db=$tmp/db
|
db=$tmp/db
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue