From 53e89ae8b4ac678c2d8b9e787328a857cf39cd60 Mon Sep 17 00:00:00 2001 From: lanxu Date: Sun, 9 Jun 2019 17:14:30 +0300 Subject: [PATCH] Added functions to ease aur usage --- .zshrc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.zshrc b/.zshrc index 7af698e..f328552 100644 --- a/.zshrc +++ b/.zshrc @@ -65,3 +65,32 @@ source $HOME/.config/base16-shell/scripts/base16-default-dark.sh #bindkey "${terminfo[khome]}" beginning-of-line #bindkey "${terminfo[kend]}" end-of-line export TERMCMD=termite + + +function auradd { + pkg=$1 + aur sync --no-view --no-confirm --database custom "$pkg" >&2 + sudo pacman -Sy "$pkg" +} + +function aurrm { + pkg=$1 + rm_out=$(repo-remove /var/cache/pacman/custom/custom.db.tar "$pkg" 2>&1) + if [[ $rm_out = *"ERROR"* ]]; then + echo "not found" >&2 + else + rm -rf /var/cache/pacman/custom/"$pkg"*.pkg.* || true + echo "$pkg removed" + fi + sudo pacman -Sy + sudo pacman -Rnc "$pkg" +} + +function aurupdate { + aur sync --no-view --no-confirm --database custom -u + sudo pacman -Syu +} + +function aurls { + sudo pacman -Sl custom +}