addet universal install alias 'install_pkg'

This commit is contained in:
pika 2024-08-19 19:19:58 +02:00
parent a991f65227
commit 03a388f509
2 changed files with 33 additions and 17 deletions

38
.bashrc
View file

@ -4,6 +4,25 @@ function echo_error() { echo -e "\033[0;1;31merror:\033[0;31m\t${*}\033[0m"; }
function echo_binfo() { echo -e "\033[0;1;34mInfo:\033[0;34m\t${*}\033[0m"; }
function echo_info() { echo -e "\033[0;35m${*}\033[0m"; }
if command_exists curl; then
alias install_pkg='bash -c "$(curl -sSL https://git.k4li.de/pika/scripts/raw/branch/main/bash/snippets/install_pkg.sh)" -- '
else
echo_error "curl is not installed, universal install disabled!"
fi
i_blesh() {
install_pkg gawk make &&
git clone https://github.com/akinomyoga/ble.sh.git /tmp/blesh &&
$(cd /tmp/blesh && make && make INSDIR="$HOME/.local/share/blesh" install)
}
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
if [[ ! -f $HOME/.local/share/blesh/ble.sh ]]; then
i_blesh
else
[[ $- == *i* ]] &&
source "$HOME/.local/share/blesh/ble.sh" --attach=none
fi
_sensible.bash_() {
# Sensible Bash - An attempt at saner Bash defaults
# Maintainer: mrzool <http://mrzool.cc>
@ -140,22 +159,8 @@ _defaults_() {
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
}
p_blesh() {
i_blesh() {
install gawk make &&
git clone https://github.com/akinomyoga/ble.sh.git /tmp/blesh &&
cd /tmp/blesh &&
make
make INSDIR="$HOME/.local/share/blesh" install
}
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
if [[ ! -e $HOME/.local/share/blesh/ble.sh ]]; then
i_blesh
else
[[ $- == *i* ]] &&
source "$HOME/.local/share/blesh/ble.sh" --attach=none
if [ -f ~/.completions/ssh ]; then
. ~/.completions/ssh
fi
}
@ -184,7 +189,6 @@ plugins() {
# [[ -s "$HOME/.qfc/bin/qfc.sh" ]] && source "$HOME/.qfc/bin/qfc.sh"
# p_basher
p_has
p_blesh
}
_color_prompt_() {

12
.completions/ssh Normal file
View file

@ -0,0 +1,12 @@
_ssh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-)
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
return 0
}
complete -F _ssh ssh