wip
This commit is contained in:
parent
bd9ad013a4
commit
c324fb889d
1 changed files with 39 additions and 7 deletions
46
.bashrc
46
.bashrc
|
@ -1,9 +1,14 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ $- == *i* ]] && source /usr/share/blesh/ble.sh --noattach
|
|
||||||
# Enable history expansion (!!, !$, etc.) in ble.sh
|
blesh=true
|
||||||
bleopt history_expand_on_space=1
|
|
||||||
# Make Tab expand history references (!!, !$, etc.)
|
if $blesh; then
|
||||||
ble-bind -f 'TAB' 'complete/expand-history'
|
[[ $- == *i* ]] && source /usr/share/blesh/ble.sh --noattach
|
||||||
|
# Enable history expansion (!!, !$, etc.) in ble.sh
|
||||||
|
bleopt history_expand_on_space=1
|
||||||
|
# Make Tab expand history references (!!, !$, etc.)
|
||||||
|
ble-bind -f 'TAB' 'complete/expand-history'
|
||||||
|
fi
|
||||||
# ─< Helper functions >─────────────────────────────────────────────────────────────────
|
# ─< Helper functions >─────────────────────────────────────────────────────────────────
|
||||||
# ───────────────────────────────────< Message storage >─────────────────────────────────
|
# ───────────────────────────────────< Message storage >─────────────────────────────────
|
||||||
declare -A _MESSAGES
|
declare -A _MESSAGES
|
||||||
|
@ -117,6 +122,29 @@ _sources() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup-keychain() {
|
||||||
|
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 --noask --agents ssh ~/.ssh/$i)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
return 69
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! setupKeys; then
|
||||||
|
eval "$(keychain --eval --noask --agents ssh ~/.ssh/{homelab-id_rsa,hetzner_id_rsa})"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
_init() {
|
_init() {
|
||||||
# ─< fzf >────────────────────────────────────────────────────────────────────────────────
|
# ─< fzf >────────────────────────────────────────────────────────────────────────────────
|
||||||
if command_exists fzf; then
|
if command_exists fzf; then
|
||||||
|
@ -156,6 +184,8 @@ _init() {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setup-keychain
|
||||||
}
|
}
|
||||||
|
|
||||||
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
|
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
|
||||||
|
@ -213,7 +243,6 @@ _env() {
|
||||||
EDITOR=nvim
|
EDITOR=nvim
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $EDITOR ]]; then
|
|
||||||
if command_exists vim; then
|
if command_exists vim; then
|
||||||
EDITOR=vim
|
EDITOR=vim
|
||||||
elif command_exists vi; then
|
elif command_exists vi; then
|
||||||
|
@ -309,4 +338,7 @@ main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
[[ ! ${BLE_VERSION-} ]] || ble-attach
|
|
||||||
|
if $blesh; then
|
||||||
|
[[ ! ${BLE_VERSION-} ]] || ble-attach
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue