summaryrefslogtreecommitdiff
path: root/plugins/archlinux
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2018-04-25 15:36:48 -0600
committerTuowen Zhao <ztuowen@gmail.com>2018-04-25 15:36:48 -0600
commit1481f7aa67df42bdf45953231637194ac200d240 (patch)
tree7d41eb6b369e3ab0f25753623c966b69340e54cf /plugins/archlinux
parentb7b623d6de696b81d213ec666d072851561d5c06 (diff)
parent9cd3701ac0297f4bdf9673ea0dffa8ffdaea63e8 (diff)
downloadzsh-1481f7aa67df42bdf45953231637194ac200d240.tar.gz
zsh-1481f7aa67df42bdf45953231637194ac200d240.tar.bz2
zsh-1481f7aa67df42bdf45953231637194ac200d240.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/archlinux')
-rw-r--r--plugins/archlinux/README.md33
-rw-r--r--plugins/archlinux/archlinux.plugin.zsh66
2 files changed, 88 insertions, 11 deletions
diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
index e408db13d..c3521c523 100644
--- a/plugins/archlinux/README.md
+++ b/plugins/archlinux/README.md
@@ -2,6 +2,31 @@
## Features
+#### TRIZEN
+
+| Alias | Command | Description |
+|---------|------------------------------------|---------------------------------------------------------------------|
+| trconf | trizen -C | Fix all configuration files with vimdiff |
+| trin | trizen -S | Install packages from the repositories |
+| trins | trizen -U | Install a package from a local file |
+| trinsd | trizen -S --asdeps | Install packages as dependencies of another package |
+| trloc | trizen -Qi | Display information about a package in the local database |
+| trlocs | trizen -Qs | Search for packages in the local database |
+| trlst | trizen -Qe | List installed packages including from AUR (tagged as "local") |
+| trmir | trizen -Syy | Force refresh of all package lists after updating mirrorlist |
+| trorph | trizen -Qtd | Remove orphans using yaourt |
+| trre | trizen -R | Remove packages, keeping its settings and dependencies |
+| trrem | trizen -Rns | Remove packages, including its settings and unneeded dependencies |
+| trrep | trizen -Si | Display information about a package in the repositories |
+| trreps | trizen -Ss | Search for packages in the repositories |
+| trupd | trizen -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
+| trupd | trizen -Sy && sudo abs | Update and refresh the local package and ABS databases |
+| trupd | trizen -Sy && sudo aur | Update and refresh the local package and AUR databases |
+| trupd | trizen -Sy | Update and refresh the local package database |
+| trupd | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
+| trsu | trizen -Syua --no-confirm | Same as `trupg`, but without confirmation |
+| upgrade | trizen -Syu | Sync with repositories before upgrading packages |
+
#### YAOURT
| Alias | Command | Description |
@@ -27,7 +52,7 @@
| yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
| upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
-### PACAUR
+#### PACAUR
| Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------|
@@ -74,7 +99,9 @@
| pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages |
| upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages |
| pacfileupg | sudo pacman -Fy | Download fresh package databases from the server |
-| pacfiles | pacman -Fs | Search package file names for matching strings. |
+| pacfiles | pacman -Fs | Search package file names for matching strings |
+| pacls | pacman -Ql | List files in a package |
+| pacown | pacman -Qo | Show which package owns a file |
| Function | Description |
|----------------|------------------------------------------------------|
@@ -82,6 +109,7 @@
| paclist | List all installed packages with a short description |
| pacmanallkeys | Get all keys for developers and trusted users |
| pacmansignkeys | Locally trust all keys passed as parameters |
+| pacweb | Open the website of an ArchLinux package |
---
@@ -95,3 +123,4 @@
- ornicar - thibault.duplessis@gmail.com
- Juraj Fiala - doctorjellyface@riseup.net
- Majora320 (Moses Miller) - Majora320@gmail.com
+- Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index 0fab1252b..ae80eb9f0 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -1,3 +1,32 @@
+if (( $+commands[trizen] )); then
+ alias trconf='trizen -C'
+ alias trupg='trizen -Syua'
+ alias trsu='trizen -Syua --noconfirm'
+ alias trin='trizen -S'
+ alias trins='trizen -U'
+ alias trre='trizen -R'
+ alias trrem='trizen -Rns'
+ alias trrep='trizen -Si'
+ alias trreps='trizen -Ss'
+ alias trloc='trizen -Qi'
+ alias trlocs='trizen -Qs'
+ alias trlst='trizen -Qe'
+ alias trorph='trizen -Qtd'
+ alias trinsd='trizen -S --asdeps'
+ alias trmir='trizen -Syy'
+
+
+ if (( $+commands[abs] && $+commands[aur] )); then
+ alias trupd='trizen -Sy && sudo abs && sudo aur'
+ elif (( $+commands[abs] )); then
+ alias trupd='trizen -Sy && sudo abs'
+ elif (( $+commands[aur] )); then
+ alias trupd='trizen -Sy && sudo aur'
+ else
+ alias trupd='trizen -Sy'
+ fi
+fi
+
if (( $+commands[yaourt] )); then
alias yaconf='yaourt -C'
alias yaupg='yaourt -Syua'
@@ -54,16 +83,20 @@ if (( $+commands[pacaur] )); then
fi
fi
-if (( $+commands[pacaur] )); then
- upgrade() {
+if (( $+commands[trizen] )); then
+ function upgrade() {
+ trizen -Syu
+ }
+elif (( $+commands[pacaur] )); then
+ function upgrade() {
pacaur -Syu
}
elif (( $+commands[yaourt] )); then
- upgrade() {
+ function upgrade() {
yaourt -Syu
}
else
- upgrade() {
+ function upgrade() {
sudo pacman -Syu
}
fi
@@ -83,7 +116,9 @@ alias pacmir='sudo pacman -Syy'
alias paclsorphans='sudo pacman -Qdt'
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
alias pacfileupg='sudo pacman -Fy'
-alias pacfiles='pacman tFs'
+alias pacfiles='pacman -Fs'
+alias pacls='pacman -Ql'
+alias pacown='pacman -Qo'
if (( $+commands[abs] && $+commands[aur] )); then
@@ -96,13 +131,13 @@ else
alias pacupd='sudo pacman -Sy'
fi
-paclist() {
+function paclist() {
# Source: https://bbs.archlinux.org/viewtopic.php?id=93683
LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \
awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
}
-pacdisowned() {
+function pacdisowned() {
emulate -L zsh
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
@@ -120,14 +155,14 @@ pacdisowned() {
comm -23 "$fs" "$db"
}
-pacmanallkeys() {
+function pacmanallkeys() {
emulate -L zsh
curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
xargs sudo pacman-key --recv-keys
}
-pacmansignkeys() {
+function pacmansignkeys() {
emulate -L zsh
for key in $*; do
sudo pacman-key --recv-keys $key
@@ -136,3 +171,16 @@ pacmansignkeys() {
--no-permission-warning --command-fd 0 --edit-key $key
done
}
+
+if (( $+commands[xdg-open] )); then
+ function 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/" &>/dev/null
+ }
+fi