Browse Source

Add pacman search by name

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

1
.config/zsh/.zshrc

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

8
.scripts/alias.sh

@ -34,10 +34,16 @@ java_run () {
java -cp './out' "$1" java -cp './out' "$1"
} }
mkcd(){ mkcd() {
mkdir -p "$1" && cd "$1" || exit 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() { pastebin() {
echo "$1" | curl -F 'f:1=<-' ix.io echo "$1" | curl -F 'f:1=<-' ix.io
} }

Loading…
Cancel
Save