archlinux.plugin.zsh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. if (( $+commands[yaourt] )); then
  2. alias yaconf='yaourt -C'
  3. alias yaupg='yaourt -Syua'
  4. alias yasu='yaourt -Syua --noconfirm'
  5. alias yain='yaourt -S'
  6. alias yains='yaourt -U'
  7. alias yare='yaourt -R'
  8. alias yarem='yaourt -Rns'
  9. alias yarep='yaourt -Si'
  10. alias yareps='yaourt -Ss'
  11. alias yaloc='yaourt -Qi'
  12. alias yalocs='yaourt -Qs'
  13. alias yalst='yaourt -Qe'
  14. alias yaorph='yaourt -Qtd'
  15. alias yainsd='yaourt -S --asdeps'
  16. alias yamir='yaourt -Syy'
  17. if (( $+commands[abs] && $+commands[aur] )); then
  18. alias yaupd='yaourt -Sy && sudo abs && sudo aur'
  19. elif (( $+commands[abs] )); then
  20. alias yaupd='yaourt -Sy && sudo abs'
  21. elif (( $+commands[aur] )); then
  22. alias yaupd='yaourt -Sy && sudo aur'
  23. else
  24. alias yaupd='yaourt -Sy'
  25. fi
  26. fi
  27. if (( $+commands[pacaur] )); then
  28. alias paupg='pacaur -Syu'
  29. alias pasu='pacaur -Syu --noconfirm'
  30. alias pain='pacaur -S'
  31. alias pains='pacaur -U'
  32. alias pare='pacaur -R'
  33. alias parem='pacaur -Rns'
  34. alias parep='pacaur -Si'
  35. alias pareps='pacaur -Ss'
  36. alias paloc='pacaur -Qi'
  37. alias palocs='pacaur -Qs'
  38. alias palst='pacaur -Qe'
  39. alias paorph='pacaur -Qtd'
  40. alias painsd='pacaur -S --asdeps'
  41. alias pamir='pacaur -Syy'
  42. if (( $+commands[abs] && $+commands[aur] )); then
  43. alias paupd='pacaur -Sy && sudo abs && sudo aur'
  44. elif (( $+commands[abs] )); then
  45. alias paupd='pacaur -Sy && sudo abs'
  46. elif (( $+commands[aur] )); then
  47. alias paupd='pacaur -Sy && sudo aur'
  48. else
  49. alias paupd='pacaur -Sy'
  50. fi
  51. fi
  52. if (( $+commands[pacaur] )); then
  53. upgrade() {
  54. pacaur -Syu
  55. }
  56. elif (( $+commands[yaourt] )); then
  57. upgrade() {
  58. yaourt -Syu
  59. }
  60. else
  61. upgrade() {
  62. sudo pacman -Syu
  63. }
  64. fi
  65. # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
  66. alias pacupg='sudo pacman -Syu'
  67. alias pacin='sudo pacman -S'
  68. alias pacins='sudo pacman -U'
  69. alias pacre='sudo pacman -R'
  70. alias pacrem='sudo pacman -Rns'
  71. alias pacrep='pacman -Si'
  72. alias pacreps='pacman -Ss'
  73. alias pacloc='pacman -Qi'
  74. alias paclocs='pacman -Qs'
  75. alias pacinsd='sudo pacman -S --asdeps'
  76. alias pacmir='sudo pacman -Syy'
  77. alias paclsorphans='sudo pacman -Qdt'
  78. alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
  79. alias pacfileupg='sudo pacman -Fy'
  80. alias pacfiles='pacman tFs'
  81. if (( $+commands[abs] && $+commands[aur] )); then
  82. alias pacupd='sudo pacman -Sy && sudo abs && sudo aur'
  83. elif (( $+commands[abs] )); then
  84. alias pacupd='sudo pacman -Sy && sudo abs'
  85. elif (( $+commands[aur] )); then
  86. alias pacupd='sudo pacman -Sy && sudo aur'
  87. else
  88. alias pacupd='sudo pacman -Sy'
  89. fi
  90. paclist() {
  91. # Source: https://bbs.archlinux.org/viewtopic.php?id=93683
  92. LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \
  93. awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
  94. }
  95. pacdisowned() {
  96. emulate -L zsh
  97. tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
  98. db=$tmp/db
  99. fs=$tmp/fs
  100. mkdir "$tmp"
  101. trap 'rm -rf "$tmp"' EXIT
  102. pacman -Qlq | sort -u > "$db"
  103. find /bin /etc /lib /sbin /usr ! -name lost+found \
  104. \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
  105. comm -23 "$fs" "$db"
  106. }
  107. pacmanallkeys() {
  108. emulate -L zsh
  109. curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
  110. awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
  111. xargs sudo pacman-key --recv-keys
  112. }
  113. pacmansignkeys() {
  114. emulate -L zsh
  115. for key in $*; do
  116. sudo pacman-key --recv-keys $key
  117. sudo pacman-key --lsign-key $key
  118. printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
  119. --no-permission-warning --command-fd 0 --edit-key $key
  120. done
  121. }