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
|
||||
[[ $- == *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'
|
||||
|
||||
blesh=true
|
||||
|
||||
if $blesh; then
|
||||
[[ $- == *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 >─────────────────────────────────────────────────────────────────
|
||||
# ───────────────────────────────────< Message storage >─────────────────────────────────
|
||||
declare -A _MESSAGES
|
||||
|
@ -117,6 +122,29 @@ _sources() {
|
|||
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() {
|
||||
# ─< fzf >────────────────────────────────────────────────────────────────────────────────
|
||||
if command_exists fzf; then
|
||||
|
@ -156,6 +184,8 @@ _init() {
|
|||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
setup-keychain
|
||||
}
|
||||
|
||||
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
|
||||
|
@ -213,7 +243,6 @@ _env() {
|
|||
EDITOR=nvim
|
||||
fi
|
||||
|
||||
if [[ -z $EDITOR ]]; then
|
||||
if command_exists vim; then
|
||||
EDITOR=vim
|
||||
elif command_exists vi; then
|
||||
|
@ -309,4 +338,7 @@ 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