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