archlinux.plugin.zsh 2.62 KB
Newer Older
1
2
3
4
5
if ! (( $+commands[yaourt] )); then
  upgrade() {
    sudo pacman -Syu
  }
else
Benjamin Boudreau's avatar
Benjamin Boudreau committed
6
  upgrade () {
7
    yaourt -Syu
Benjamin Boudreau's avatar
Benjamin Boudreau committed
8
  }
9
10
11

  alias yaconf='yaourt -C'
  alias yaupg='yaourt -Syua'
12
  alias yasu='yaourt -Syua --noconfirm'
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  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'


27
  if (( $+commands[abs] && $+commands[aur] )); then
28
    alias yaupd='yaourt -Sy && sudo abs && sudo aur'
29
  elif (( $+commands[abs] )); then
30
    alias yaupd='yaourt -Sy && sudo abs'
31
  elif (( $+commands[aur] )); then
32
    alias yaupd='yaourt -Sy && sudo aur'
33
  else
34
    alias yaupd='yaourt -Sy'
35
  fi
Benjamin Boudreau's avatar
Benjamin Boudreau committed
36
37
38
fi

# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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)'


54
if (( $+commands[abs] && $+commands[aur] )); then
55
  alias pacupd='sudo pacman -Sy && sudo abs && sudo aur'
56
elif (( $+commands[abs] )); then
57
  alias pacupd='sudo pacman -Sy && sudo abs'
58
elif (( $+commands[aur] )); then
59
  alias pacupd='sudo pacman -Sy && sudo aur'
60
else
61
  alias pacupd='sudo pacman -Sy'
62
fi
Benjamin Boudreau's avatar
Benjamin Boudreau committed
63
64

paclist() {
65
66
67
  # 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
68
}
Benjamin Boudreau's avatar
Benjamin Boudreau committed
69

Benjamin Boudreau's avatar
Benjamin Boudreau committed
70
pacdisowned() {
71
72
  emulate -L zsh

Benjamin Boudreau's avatar
Benjamin Boudreau committed
73
74
75
76
77
78
79
80
81
  tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
  db=$tmp/db
  fs=$tmp/fs

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

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

82
83
  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
84
85
86

  comm -23 "$fs" "$db"
}
87
88

pacmanallkeys() {
89
90
  emulate -L zsh
  curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
91
92
    awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
    xargs sudo pacman-key --recv-keys
93
94
95
}

pacmansignkeys() {
96
  emulate -L zsh
97
98
99
100
101
102
103
  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
}