addet keychain setup

This commit is contained in:
pika 2025-05-17 12:11:42 +02:00
parent 9daa6e0d58
commit b3e8bfdc50

29
.zshrc
View file

@ -551,10 +551,10 @@ __alias__() {
# ─< t stands for trash(-cli) >───────────────────────────────────────────────────────────────
if command_exists trash; then
alias rm="trash"
alias rm="trash $@"
alias t="trash"
elif command_exists trash-cli; then
alias rm="trash-cli"
alias rm="trash-cli $@"
alias t="trash-cli"
else
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'
setopt autocd notify
# 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__() {
@ -813,6 +837,7 @@ main() {
__alias__
__sources__
__end__
__keychain_setup__
}
if check_root; then