archlinux.plugin.zsh 3.44 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
31
32
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
67
68
69
70
if (( $+commands[pacaur] )); then
  alias paupg='pacaur -Syua'
  alias pasu='pacaur -Syua --noconfirm'
  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() {
    pacman -Syu
  }
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
85
86
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)'


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

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

Benjamin Boudreau's avatar
Benjamin Boudreau committed
103
pacdisowned() {
104
105
  emulate -L zsh

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

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

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

115
116
  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
117
118
119

  comm -23 "$fs" "$db"
}
120
121

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

pacmansignkeys() {
129
  emulate -L zsh
130
131
132
133
134
135
136
  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
}