From 3320658f30e0556bae0844629a265ae71f807cc1 Mon Sep 17 00:00:00 2001 From: KeLiu Date: Tue, 9 Oct 2018 00:48:02 +0800 Subject: [PATCH] archlinux: add aliases for yay (#6867) --- plugins/archlinux/README.md | 20 ++++++++++++++++ plugins/archlinux/archlinux.plugin.zsh | 33 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md index 0d1fdea3a..7ebe8e53d 100644 --- a/plugins/archlinux/README.md +++ b/plugins/archlinux/README.md @@ -2,6 +2,26 @@ ## Features +#### YAY + +| Alias | Command | Description | +|---------|------------------------------------|---------------------------------------------------------------------| +| yaconf | yay -Pg | Print current configuration | +| yain | yay -S | Install packages from the repositories | +| yains | yay -U | Install a package from a local file | +| yainsd | yay -S --asdeps | Install packages as dependencies of another package | +| yaloc | yay -Qi | Display information about a package in the local database | +| yalocs | yay -Qs | Search for packages in the local database | +| yalst | yay -Qe | List installed packages including from AUR (tagged as "local") | +| yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist | +| yaorph | yay -Qtd | Remove orphans using yaourt | +| yare | yay -R | Remove packages, keeping its settings and dependencies | +| yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies | +| yarep | yay -Si | Display information about a package in the repositories | +| yareps | yay -Ss | Search for packages in the repositories | +| yaupg | yay -Syu | Sync with repositories before upgrading packages | +| yasu | yay -Syu --no-confirm | Same as `yaupg`, but without confirmation | + #### TRIZEN | Alias | Command | Description | diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index ae80eb9f0..e0101c7eb 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -56,6 +56,35 @@ if (( $+commands[yaourt] )); then fi fi +if (( $+commands[yay] )); then + alias yaconf='yay -Pg' + alias yaupg='yay -Syu' + alias yasu='yay -Syu --noconfirm' + alias yain='yay -S' + alias yains='yay -U' + alias yare='yay -R' + alias yarem='yay -Rns' + alias yarep='yay -Si' + alias yareps='yay -Ss' + alias yaloc='yay -Qi' + alias yalocs='yay -Qs' + alias yalst='yay -Qe' + alias yaorph='yay -Qtd' + alias yainsd='yay -S --asdeps' + alias yamir='yay -Syy' + + + if (( $+commands[abs] && $+commands[aur] )); then + alias yaupd='yay -Sy && sudo abs && sudo aur' + elif (( $+commands[abs] )); then + alias yaupd='yay -Sy && sudo abs' + elif (( $+commands[aur] )); then + alias yaupd='yay -Sy && sudo aur' + else + alias yaupd='yay -Sy' + fi +fi + if (( $+commands[pacaur] )); then alias paupg='pacaur -Syu' alias pasu='pacaur -Syu --noconfirm' @@ -95,6 +124,10 @@ elif (( $+commands[yaourt] )); then function upgrade() { yaourt -Syu } +elif (( $+commands[yay] )); then + function upgrade() { + yay -Syu + } else function upgrade() { sudo pacman -Syu