From d0320ebe8382443814ad87717296c40a8dd1117b Mon Sep 17 00:00:00 2001 From: pika <67532734+pik4li@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:45:57 +0100 Subject: [PATCH] addet blesh again --- .bash/themes | 1 + .bashrc | 82 +++++++++++++++++++++++++++++++++++++++++++++++----- .gitmodules | 4 +++ 3 files changed, 79 insertions(+), 8 deletions(-) create mode 160000 .bash/themes create mode 100644 .gitmodules diff --git a/.bash/themes b/.bash/themes new file mode 160000 index 0000000..5cf9b70 --- /dev/null +++ b/.bash/themes @@ -0,0 +1 @@ +Subproject commit 5cf9b70cb0ba348a5b62792533a01f27034ebcb4 diff --git a/.bashrc b/.bashrc index aa65054..a609c7f 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e09bac2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule ".bash/themes"] + path = .bash/themes + url = https://git.k4li.de/dotfiles/oh-my-posh.git + branch = main