addet keychain setup
This commit is contained in:
parent
9daa6e0d58
commit
b3e8bfdc50
1 changed files with 27 additions and 2 deletions
29
.zshrc
29
.zshrc
|
@ -551,10 +551,10 @@ __alias__() {
|
||||||
|
|
||||||
# ─< t stands for trash(-cli) >───────────────────────────────────────────────────────────────
|
# ─< t stands for trash(-cli) >───────────────────────────────────────────────────────────────
|
||||||
if command_exists trash; then
|
if command_exists trash; then
|
||||||
alias rm="trash"
|
alias rm="trash $@"
|
||||||
alias t="trash"
|
alias t="trash"
|
||||||
elif command_exists trash-cli; then
|
elif command_exists trash-cli; then
|
||||||
alias rm="trash-cli"
|
alias rm="trash-cli $@"
|
||||||
alias t="trash-cli"
|
alias t="trash-cli"
|
||||||
else
|
else
|
||||||
echo_error "-- You do not have trash or trash-cli installed! Your 'rm' will be permanent! --"
|
echo_error "-- You do not have trash or trash-cli installed! Your 'rm' will be permanent! --"
|
||||||
|
@ -786,6 +786,30 @@ __defaults__() {
|
||||||
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
||||||
setopt autocd notify
|
setopt autocd notify
|
||||||
# End of lines configured by zsh-newuser-install
|
# End of lines configured by zsh-newuser-install
|
||||||
|
#
|
||||||
|
}
|
||||||
|
|
||||||
|
__keychain_setup__() {
|
||||||
|
setupKeys() {
|
||||||
|
local keys=(
|
||||||
|
"homelab-id_rsa"
|
||||||
|
"hetzner_id_rsa"
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in "${keys[@]}"; do
|
||||||
|
if [ -n $i ]; then
|
||||||
|
if [ -e "$i" ]; then
|
||||||
|
eval "$(keychain --eval --agents ssh ~/.ssh/$i)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
return 69
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! setupKeys; then
|
||||||
|
eval "$(keychain --eval --agents ssh)"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
__end__() {
|
__end__() {
|
||||||
|
@ -813,6 +837,7 @@ main() {
|
||||||
__alias__
|
__alias__
|
||||||
__sources__
|
__sources__
|
||||||
__end__
|
__end__
|
||||||
|
__keychain_setup__
|
||||||
}
|
}
|
||||||
|
|
||||||
if check_root; then
|
if check_root; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue