08711cd8f7e9d678dd321dee926e3e77c8188b8f

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #475 from dreur/upstream-archlinux-plugin

Added archlinux plugin

Diff

 1diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..acb8df057c16e0b876c56f22e9f4111a0b53a6bd
 4--- /dev/null
 5+++ b/plugins/archlinux/archlinux.plugin.zsh
 6@@ -0,0 +1,67 @@
 7+# Archlinux zsh aliases and functions for zsh
 8+
 9+# Aliases ###################################################################
10+
11+# Look for yaourt, and add some useful functions if we have it.
12+if [[ -x `which yaourt` ]]; then
13+  upgrade () {
14+    yaourt -Syu -C
15+  }
16+  # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
17+  alias yaupg='sudo yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
18+  alias yain='sudo yaourt -S'           # Install specific package(s) from the repositories
19+  alias yains='sudo yaourt -U'          # Install specific package not from the repositories but from a file 
20+  alias yare='sudo yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
21+  alias yarem='sudo yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
22+  alias yarep='yaourt -Si'              # Display information about a given package in the repositories
23+  alias yareps='yaourt -Ss'             # Search for package(s) in the repositories
24+  alias yaloc='yaourt -Qi'              # Display information about a given package in the local database
25+  alias yalocs='yaourt -Qs'             # Search for package(s) in the local database
26+  # Additional yaourt alias examples
27+  alias yaupd='sudo yaourt -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
28+  alias yainsd='sudo yaourt -S --asdeps'        # Install given package(s) as dependencies of another package
29+  alias yamir='sudo yaourt -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
30+else
31+ upgrade() {
32+   sudo pacman -Syu
33+ }
34+fi
35+
36+# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
37+alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
38+alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
39+alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file 
40+alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
41+alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
42+alias pacrep='pacman -Si'              # Display information about a given package in the repositories
43+alias pacreps='pacman -Ss'             # Search for package(s) in the repositories
44+alias pacloc='pacman -Qi'              # Display information about a given package in the local database
45+alias paclocs='pacman -Qs'             # Search for package(s) in the local database
46+# Additional pacman alias examples
47+alias pacupd='sudo pacman -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
48+alias pacinsd='sudo pacman -S --asdeps'        # Install given package(s) as dependencies of another package
49+alias pacmir='sudo pacman -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
50+
51+# https://bbs.archlinux.org/viewtopic.php?id=93683
52+paclist() {
53+  sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
54+}
55+alias paclsorhpans='sudo pacman -Qdt'
56+alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
57+
58+pacdisowned() {
59+  tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
60+  db=$tmp/db
61+  fs=$tmp/fs
62+
63+  mkdir "$tmp"
64+  trap  'rm -rf "$tmp"' EXIT
65+
66+  pacman -Qlq | sort -u > "$db"
67+
68+  find /bin /etc /lib /sbin /usr \
69+      ! -name lost+found \
70+        \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
71+
72+  comm -23 "$fs" "$db"
73+}