archlinux.plugin.zsh 3.5 KB
Newer Older
1
if (( $+commands[yaourt] )); then
2
3
  alias yaconf='yaourt -C'
  alias yaupg='yaourt -Syua'
4
  alias yasu='yaourt -Syua --noconfirm'
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  alias yain='yaourt -S'
  alias yains='yaourt -U'
  alias yare='yaourt -R'
  alias yarem='yaourt -Rns'
  alias yarep='yaourt -Si'
  alias yareps='yaourt -Ss'
  alias yaloc='yaourt -Qi'
  alias yalocs='yaourt -Qs'
  alias yalst='yaourt -Qe'
  alias yaorph='yaourt -Qtd'
  alias yainsd='yaourt -S --asdeps'
  alias yamir='yaourt -Syy'


19
  if (( $+commands[abs] && $+commands[aur] )); then
20
    alias yaupd='yaourt -Sy && sudo abs && sudo aur'
21
  elif (( $+commands[abs] )); then
22
    alias yaupd='yaourt -Sy && sudo abs'
23
  elif (( $+commands[aur] )); then
24
    alias yaupd='yaourt -Sy && sudo aur'
25
  else
26
    alias yaupd='yaourt -Sy'
27
  fi
Benjamin Boudreau's avatar
Benjamin Boudreau committed
28
29
fi

30
if (( $+commands[pacaur] )); then
Ning Sun's avatar
Ning Sun committed
31
32
  alias paupg='pacaur -Syu'
  alias pasu='pacaur -Syu --noconfirm'
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  alias pain='pacaur -S'
  alias pains='pacaur -U'
  alias pare='pacaur -R'
  alias parem='pacaur -Rns'
  alias parep='pacaur -Si'
  alias pareps='pacaur -Ss'
  alias paloc='pacaur -Qi'
  alias palocs='pacaur -Qs'
  alias palst='pacaur -Qe'
  alias paorph='pacaur -Qtd'
  alias painsd='pacaur -S --asdeps'
  alias pamir='pacaur -Syy'

  if (( $+commands[abs] && $+commands[aur] )); then
    alias paupd='pacaur -Sy && sudo abs && sudo aur'
  elif (( $+commands[abs] )); then
    alias paupd='pacaur -Sy && sudo abs'
  elif (( $+commands[aur] )); then
    alias paupd='pacaur -Sy && sudo aur'
  else
    alias paupd='pacaur -Sy'
  fi
fi

if (( $+commands[pacaur] )); then
  upgrade() {
    pacaur -Syu
  }
elif (( $+commands[yaourt] )); then
  upgrade() {
    yaourt -Syu
  }
else
  upgrade() {
67
    sudo pacman -Syu
68
69
70
  }
fi

Benjamin Boudreau's avatar
Benjamin Boudreau committed
71
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
72
73
74
75
76
77
78
79
80
81
82
83
84
alias pacupg='sudo pacman -Syu'
alias pacin='sudo pacman -S'
alias pacins='sudo pacman -U'
alias pacre='sudo pacman -R'
alias pacrem='sudo pacman -Rns'
alias pacrep='pacman -Si'
alias pacreps='pacman -Ss'
alias pacloc='pacman -Qi'
alias paclocs='pacman -Qs'
alias pacinsd='sudo pacman -S --asdeps'
alias pacmir='sudo pacman -Syy'
alias paclsorphans='sudo pacman -Qdt'
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
85
alias pacfileupg='sudo pacman -Fy'
86
alias pacfiles='pacman -Fs'
87
88


89
if (( $+commands[abs] && $+commands[aur] )); then
90
  alias pacupd='sudo pacman -Sy && sudo abs && sudo aur'
91
elif (( $+commands[abs] )); then
92
  alias pacupd='sudo pacman -Sy && sudo abs'
93
elif (( $+commands[aur] )); then
94
  alias pacupd='sudo pacman -Sy && sudo aur'
95
else
96
  alias pacupd='sudo pacman -Sy'
97
fi
Benjamin Boudreau's avatar
Benjamin Boudreau committed
98
99

paclist() {
100
101
102
  # 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}'
Benjamin Boudreau's avatar
Benjamin Boudreau committed
103
}
Benjamin Boudreau's avatar
Benjamin Boudreau committed
104

Benjamin Boudreau's avatar
Benjamin Boudreau committed
105
pacdisowned() {
106
107
  emulate -L zsh

Benjamin Boudreau's avatar
Benjamin Boudreau committed
108
109
110
111
112
113
114
115
116
  tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
  db=$tmp/db
  fs=$tmp/fs

  mkdir "$tmp"
  trap  'rm -rf "$tmp"' EXIT

  pacman -Qlq | sort -u > "$db"

117
118
  find /bin /etc /lib /sbin /usr ! -name lost+found \
    \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
Benjamin Boudreau's avatar
Benjamin Boudreau committed
119
120
121

  comm -23 "$fs" "$db"
}
122
123

pacmanallkeys() {
124
125
  emulate -L zsh
  curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
126
127
    awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
    xargs sudo pacman-key --recv-keys
128
129
130
}

pacmansignkeys() {
131
  emulate -L zsh
132
133
134
135
136
137
138
  for key in $*; do
    sudo pacman-key --recv-keys $key
    sudo pacman-key --lsign-key $key
    printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
      --no-permission-warning --command-fd 0 --edit-key $key
  done
}