Browse Source

Add pacman search by name

master
Riyyi 4 years ago
parent
commit
fed4077f08
  1. 1
      .config/zsh/.zshrc
  2. 6
      .scripts/alias.sh

1
.config/zsh/.zshrc

@ -110,6 +110,7 @@ alias update="sudo pacman -Syyu"
alias clean='sudo pacman -Rns $(pacman -Qtdq)'
alias cache="sudo paccache -r -k 2"
alias depend="$HOME/.scripts/alias.sh depend"
alias search="$HOME/.scripts/alias.sh pacman_search"
# Programming
alias jdoc="$HOME/.scripts/alias.sh java_doc"

6
.scripts/alias.sh

@ -38,6 +38,12 @@ mkcd(){
mkdir -p "$1" && cd "$1" || exit
}
# Search for packages, by name only
pacman_search() {
pacman -Ss "$1" --color=always | \
awk -v m="$1" '{ if ($0 !~ /^\s/) { if ($1 ~ m) { print; }} else { print; }}'
}
pastebin() {
echo "$1" | curl -F 'f:1=<-' ix.io
}

Loading…
Cancel
Save