Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
790f185e
Unverified
Commit
790f185e
authored
Apr 06, 2021
by
ratijas
Committed by
GitHub
Apr 06, 2021
Browse files
refactor(archlinux): fix name & scripts; reorder aliases (#9546)
Co-authored-by:
Marc Cornellà
<
hello@mcornella.com
>
parent
279212f2
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
plugins/archlinux/README.md
View file @
790f185e
This diff is collapsed.
Click to expand it.
plugins/archlinux/archlinux.plugin.zsh
View file @
790f185e
if
((
$+
commands[trizen]
))
;
then
#######################################
alias
trconf
=
'trizen -C'
# Pacman #
alias
trupg
=
'trizen -Syua'
#######################################
alias
trsu
=
'trizen -Syua --noconfirm'
alias
trin
=
'trizen -S'
alias
trins
=
'trizen -U'
alias
trre
=
'trizen -R'
alias
trrem
=
'trizen -Rns'
alias
trrep
=
'trizen -Si'
alias
trreps
=
'trizen -Ss'
alias
trloc
=
'trizen -Qi'
alias
trlocs
=
'trizen -Qs'
alias
trlst
=
'trizen -Qe'
alias
trorph
=
'trizen -Qtd'
alias
trinsd
=
'trizen -S --asdeps'
alias
trmir
=
'trizen -Syy'
# abs and aur command check
local
abs_aur
=
''
((
!
$+
commands[abs]
))
||
abs_aur+
=
' && sudo abs'
((
!
$+
commands[aur]
))
||
abs_aur+
=
' && sudo aur'
if
((
$+
commands[abs]
&&
$+
commands[aur]
))
;
then
alias
trupd
=
'trizen -Sy && sudo abs && sudo aur'
elif
((
$+
commands[abs]
))
;
then
alias
trupd
=
'trizen -Sy && sudo abs'
elif
((
$+
commands[aur]
))
;
then
alias
trupd
=
'trizen -Sy && sudo aur'
else
alias
trupd
=
'trizen -Sy'
fi
fi
if
((
$+
commands[yaourt]
))
;
then
alias
yaconf
=
'yaourt -C'
alias
yaupg
=
'yaourt -Syua'
alias
yasu
=
'yaourt -Syua --noconfirm'
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'
if
((
$+
commands[abs]
&&
$+
commands[aur]
))
;
then
alias
yaupd
=
'yaourt -Sy && sudo abs && sudo aur'
elif
((
$+
commands[abs]
))
;
then
alias
yaupd
=
'yaourt -Sy && sudo abs'
elif
((
$+
commands[aur]
))
;
then
alias
yaupd
=
'yaourt -Sy && sudo aur'
else
alias
yaupd
=
'yaourt -Sy'
fi
fi
if
((
$+
commands[yay]
))
;
then
alias
yaconf
=
'yay -Pg'
alias
yaupg
=
'yay -Syu'
alias
yasu
=
'yay -Syu --noconfirm'
alias
yain
=
'yay -S'
alias
yains
=
'yay -U'
alias
yare
=
'yay -R'
alias
yarem
=
'yay -Rns'
alias
yarep
=
'yay -Si'
alias
yareps
=
'yay -Ss'
alias
yaloc
=
'yay -Qi'
alias
yalocs
=
'yay -Qs'
alias
yalst
=
'yay -Qe'
alias
yaorph
=
'yay -Qtd'
alias
yainsd
=
'yay -S --asdeps'
alias
yamir
=
'yay -Syy'
if
((
$+
commands[abs]
&&
$+
commands[aur]
))
;
then
alias
yaupd
=
'yay -Sy && sudo abs && sudo aur'
elif
((
$+
commands[abs]
))
;
then
alias
yaupd
=
'yay -Sy && sudo abs'
elif
((
$+
commands[aur]
))
;
then
alias
yaupd
=
'yay -Sy && sudo aur'
else
alias
yaupd
=
'yay -Sy'
fi
fi
if
((
$+
commands[pacaur]
))
;
then
alias
paupg
=
'pacaur -Syu'
alias
pasu
=
'pacaur -Syu --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[trizen]
))
;
then
function
upgrade
()
{
trizen
-Syu
}
elif
((
$+
commands[pacaur]
))
;
then
function
upgrade
()
{
pacaur
-Syu
}
elif
((
$+
commands[yaourt]
))
;
then
function
upgrade
()
{
yaourt
-Syu
}
elif
((
$+
commands[yay]
))
;
then
function
upgrade
()
{
yay
-Syu
}
else
function
upgrade
()
{
sudo
pacman
-Syu
}
fi
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias
pacupg
=
'sudo pacman -Syu'
alias
pacupg
=
'sudo pacman -Syu'
...
@@ -152,22 +26,14 @@ alias pacfileupg='sudo pacman -Fy'
...
@@ -152,22 +26,14 @@ alias pacfileupg='sudo pacman -Fy'
alias
pacfiles
=
'pacman -F'
alias
pacfiles
=
'pacman -F'
alias
pacls
=
'pacman -Ql'
alias
pacls
=
'pacman -Ql'
alias
pacown
=
'pacman -Qo'
alias
pacown
=
'pacman -Qo'
alias
pacupd
=
"sudo pacman -Sy
$abs_aur
"
alias
upgrade
=
'sudo pacman -Syu'
if
((
$+
commands[abs]
&&
$+
commands[aur]
))
;
then
alias
pacupd
=
'sudo pacman -Sy && sudo abs && sudo aur'
elif
((
$+
commands[abs]
))
;
then
alias
pacupd
=
'sudo pacman -Sy && sudo abs'
elif
((
$+
commands[aur]
))
;
then
alias
pacupd
=
'sudo pacman -Sy && sudo aur'
else
alias
pacupd
=
'sudo pacman -Sy'
fi
function
paclist
()
{
function
paclist
()
{
# Source: https://bbs.archlinux.org/viewtopic.php?id=93683
# Based on https://bbs.archlinux.org/viewtopic.php?id=93683
LC_ALL
=
C pacman
-Qei
$(
pacman
-Qu
|
cut
-d
" "
-f
1
)
|
\
pacman
-Qqe
|
\
awk
'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
xargs
-I
'{}'
\
expac
"
${
bold_color
}
% 20n
${
fg_no_bold
[white]
}
%d
${
reset_color
}
"
'{}'
}
}
function
pacdisowned
()
{
function
pacdisowned
()
{
...
@@ -187,11 +53,7 @@ function pacdisowned() {
...
@@ -187,11 +53,7 @@ function pacdisowned() {
comm
-23
"
$fs
"
"
$db
"
comm
-23
"
$fs
"
"
$db
"
}
}
function
pacmanallkeys
()
{
alias
pacmanallkeys
=
'sudo pacman-key --refresh-keys'
curl
-sL
https://www.archlinux.org/people/
{
developers,trusted-users
}
/ |
\
awk
-F
\"
'(/keyserver.ubuntu.com/) { sub(/.*search=0x/,""); print $1}'
|
\
xargs
sudo
pacman-key
--recv-keys
}
function
pacmansignkeys
()
{
function
pacmansignkeys
()
{
local
key
local
key
...
@@ -205,6 +67,15 @@ function pacmansignkeys() {
...
@@ -205,6 +67,15 @@ function pacmansignkeys() {
if
((
$+
commands[xdg-open]
))
;
then
if
((
$+
commands[xdg-open]
))
;
then
function
pacweb
()
{
function
pacweb
()
{
if
[[
$#
=
0
||
"
$1
"
=
~
'--help|-h'
]]
;
then
local
underline_color
=
"
\e
[
${
color
[underline]
}
m"
echo
"
$0
- open the website of an ArchLinux package"
echo
echo
"Usage:"
echo
"
$bold_color$0$reset_color
${
underline_color
}
target
${
reset_color
}
"
return
1
fi
local
pkg
=
"
$1
"
local
pkg
=
"
$1
"
local
infos
=
"
$(
LANG
=
C pacman
-Si
"
$pkg
"
)
"
local
infos
=
"
$(
LANG
=
C pacman
-Si
"
$pkg
"
)
"
if
[[
-z
"
$infos
"
]]
;
then
if
[[
-z
"
$infos
"
]]
;
then
...
@@ -215,3 +86,88 @@ if (( $+commands[xdg-open] )); then
...
@@ -215,3 +86,88 @@ if (( $+commands[xdg-open] )); then
xdg-open
"https://www.archlinux.org/packages/
$repo
/
$arch
/
$pkg
/"
&>/dev/null
xdg-open
"https://www.archlinux.org/packages/
$repo
/
$arch
/
$pkg
/"
&>/dev/null
}
}
fi
fi
#######################################
# AUR helpers #
#######################################
if
((
$+
commands[pacaur]
))
;
then
alias
paupg
=
'pacaur -Syu'
alias
pasu
=
'pacaur -Syu --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'
alias
paupd
=
"pacaur -Sy
$abs_aur
"
alias
upgrade
=
'pacaur -Syu'
fi
if
((
$+
commands[trizen]
))
;
then
alias
trconf
=
'trizen -C'
alias
trupg
=
'trizen -Syua'
alias
trsu
=
'trizen -Syua --noconfirm'
alias
trin
=
'trizen -S'
alias
trins
=
'trizen -U'
alias
trre
=
'trizen -R'
alias
trrem
=
'trizen -Rns'
alias
trrep
=
'trizen -Si'
alias
trreps
=
'trizen -Ss'
alias
trloc
=
'trizen -Qi'
alias
trlocs
=
'trizen -Qs'
alias
trlst
=
'trizen -Qe'
alias
trorph
=
'trizen -Qtd'
alias
trinsd
=
'trizen -S --asdeps'
alias
trmir
=
'trizen -Syy'
alias
trupd
=
"trizen -Sy
$abs_aur
"
alias
upgrade
=
'trizen -Syu'
fi
if
((
$+
commands[yaourt]
))
;
then
alias
yaconf
=
'yaourt -C'
alias
yaupg
=
'yaourt -Syua'
alias
yasu
=
'yaourt -Syua --noconfirm'
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'
alias
yaupd
=
"yaourt -Sy
$abs_aur
"
alias
upgrade
=
'yaourt -Syu'
fi
if
((
$+
commands[yay]
))
;
then
alias
yaconf
=
'yay -Pg'
alias
yaupg
=
'yay -Syu'
alias
yasu
=
'yay -Syu --noconfirm'
alias
yain
=
'yay -S'
alias
yains
=
'yay -U'
alias
yare
=
'yay -R'
alias
yarem
=
'yay -Rns'
alias
yarep
=
'yay -Si'
alias
yareps
=
'yay -Ss'
alias
yaloc
=
'yay -Qi'
alias
yalocs
=
'yay -Qs'
alias
yalst
=
'yay -Qe'
alias
yaorph
=
'yay -Qtd'
alias
yainsd
=
'yay -S --asdeps'
alias
yamir
=
'yay -Syy'
alias
yaupd
=
"yay -Sy
$abs_aur
"
alias
upgrade
=
'yay -Syu'
fi
unset
abs_aur
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment