addet blesh again

This commit is contained in:
pika 2025-01-05 20:45:57 +01:00
parent 8148efb95c
commit d0320ebe83
3 changed files with 79 additions and 8 deletions

1
.bash/themes Submodule

@ -0,0 +1 @@
Subproject commit 5cf9b70cb0ba348a5b62792533a01f27034ebcb4

82
.bashrc
View file

@ -173,6 +173,10 @@ _defaults_() {
eval "$(zoxide init bash)"
fi
if command_exists fzf; then
eval "$(fzf --bash)"
fi
# ─< colored everything >───────────────────────────────────────────────────────────────────
alias ip="ip --color=always"
@ -199,13 +203,39 @@ _defaults_() {
# ─< oh-my-posh initialization >────────────────────────────────────────────────────────────
if command_exists oh-my-posh; then
# eval "$(oh-my-posh init bash --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/amro.omp.json')"
eval "$(oh-my-posh init bash --config 'https://git.k4li.de/dotfiles/oh-my-posh/raw/branch/main/amro.toml')"
# eval "$(oh-my-posh init bash --config '~/gitea/dotfiles/oh-my-posh/amro.toml')"
eval "$(oh-my-posh init bash --config '~/.bash/themes/zen.toml')"
else
curl -s https://ohmyposh.dev/install.sh | sudo bash -s -- -d /usr/bin/
if command_exists curl; then
curl -s https://ohmyposh.dev/install.sh | $_sudo bash -s -- -d /usr/bin/
fi
fi
# ─< neovim >─────────────────────────────────────────────────────────────────────────────
if command_exists nvim; then
alias cnvim="command nvim"
if [ -d "$HOME/.config/nvchad" ]; then
alias nvchad='NVIM_APPNAME="nvchad" command nvim'
fi
fi
# ─< cli explorer >───────────────────────────────────────────────────────────────────────
if command_exists yazi; then
echo_info "yazi is the explorer of choise"
alias lf="yazi || ya pack -i"
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
elif command_exists ranger; then
echo_info "ranger is the explorer of choise"
alias lf="ranger"
elif command_exists lf; then
echo_info "lf is the explorer of choise"
fi
# ─< rsync >────────────────────────────────────────────────────────────────────────────────
if command_exists rsync; then
alias scp="rsync -avP"
@ -236,11 +266,21 @@ _defaults_() {
# ─< g stands for GIT >─────────────────────────────────────────────────────────────────────
if command_exists git; then
alias g="git"
alias gs="git status"
alias gm='git checkout main && git merge'
alias gc="git clone --recurse-submodule"
alias gs="git status -sb"
alias gc="git clone --recurse-submodule --depth=1"
gcl() {
git clone --depth=1 "https://github.com/$*"
if [ -z "$2" ]; then
git clone --depth=1 "https://github.com/$1"
else
git clone --depth=1 "https://github.com/$1" "$2"
fi
}
gck() {
if [ -z "$2" ]; then
git clone --recurse-submodules --depth=1 "https://git.k4li.de/$1"
else
git clone --recurse-submodules --depth=1 "https://git.k4li.de/$1" "$2"
fi
}
alias ga="git add"
alias gp="git pull --recurse-submodule"
@ -321,6 +361,32 @@ _defaults_() {
fi
}
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
i_blesh() {
for deeps in git make; do
if ! command_exists $deeps; then
echo_error "$deeps was missing from the system, cannot setup shell properly! (blesh setup)"
exit 1
fi
done
local tmp_dir="$(mktemp -d)"
cd "$tmp_dir" || echo_error "$tmp_dir is not valid!"
git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git app
cd ./app || echo_error "$tmp_dir/app is not valid"
make -C ble.sh install PREFIX=~/.local
}
p_blesh() {
if [[ ! -f $HOME/.local/share/blesh/ble.sh ]]; then
i_blesh
else
# . "$HOME/.local/share/blesh/ble.sh" --attach=none
. "$HOME/.local/share/blesh/ble.sh"
fi
}
_color_prompt_() {
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in

4
.gitmodules vendored Normal file
View file

@ -0,0 +1,4 @@
[submodule ".bash/themes"]
path = .bash/themes
url = https://git.k4li.de/dotfiles/oh-my-posh.git
branch = main