diff --git a/dot/.bashrc b/dot/.bashrc index 54cebf1..2e4a849 100644 --- a/dot/.bashrc +++ b/dot/.bashrc @@ -48,7 +48,7 @@ if [[ -n $(type -t _comp__split_longopt) ]] && [[ -z $(type -t _split_longopt) ] alias _split_longopt="_comp__split_longopt" fi -for _ in ${HOME}/.bashrc.d/*; do +for _ in ${HOME}/.bashrc.d/manager/*; do if [[ $_ == *.@(bash|sh) && -r $_ ]]; then source "$_" fi @@ -57,3 +57,9 @@ done if [[ -n "$(type -t mise-activate)" ]]; then mise-activate fi + +for _ in ${HOME}/.bashrc.d/*; do + if [[ $_ == *.@(bash|sh) && -r $_ ]]; then + source "$_" + fi +done diff --git a/dot/.bashrc.d/mise.bash b/dot/.bashrc.d/manager/mise.bash similarity index 71% rename from dot/.bashrc.d/mise.bash rename to dot/.bashrc.d/manager/mise.bash index 1bceb9d..2431341 100644 --- a/dot/.bashrc.d/mise.bash +++ b/dot/.bashrc.d/manager/mise.bash @@ -1,15 +1,14 @@ basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) -source "${basedir}/function.bash" +source "${basedir}/../function.bash" unset basedir if [[ -x $(type -p mise) ]]; then - completion_cmd="mise completion --include-bash-completion-lib bash" - generate-bash-completion mise "$completion_cmd" - unset completion_cmd - mise-activate() { eval "$(mise activate bash)" + + local completion_cmd="mise completion --include-bash-completion-lib bash" + generate-bash-completion mise "$completion_cmd" } mise-deactivate() { diff --git a/dot/.bashrc.d/rust.bash b/dot/.bashrc.d/manager/rust.bash similarity index 91% rename from dot/.bashrc.d/rust.bash rename to dot/.bashrc.d/manager/rust.bash index bda869e..730ce0d 100644 --- a/dot/.bashrc.d/rust.bash +++ b/dot/.bashrc.d/manager/rust.bash @@ -1,5 +1,5 @@ basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) -source "${basedir}/function.bash" +source "${basedir}/../function.bash" unset basedir diff --git a/dot/.bashrc.d/uv.bash b/dot/.bashrc.d/uv.bash new file mode 100644 index 0000000..138b13c --- /dev/null +++ b/dot/.bashrc.d/uv.bash @@ -0,0 +1,12 @@ +basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) +source "${basedir}/function.bash" + +unset basedir + +if [[ -x "$(type -p uv)" ]]; then + generate-bash-completion uv "uv generate-shell-completion bash" +fi + +if [[ -x "$(type -p uvx)" ]]; then + generate-bash-completion uvx "uvx --generate-shell-completion bash" +fi diff --git a/dot/.bashrc.d/volta.bash b/dot/.bashrc.d/volta.bash index a0b2628..2716380 100644 --- a/dot/.bashrc.d/volta.bash +++ b/dot/.bashrc.d/volta.bash @@ -6,10 +6,9 @@ unset basedir export VOLTA_HOME="${HOME}/.volta" if [[ -x $(type -p volta) || -x "${VOLTA_HOME}/bin/volta" ]]; then - generate-bash-completion volta "volta completions bash" - volta-activate() { add-to-path "${VOLTA_HOME}/bin" + generate-bash-completion volta "volta completions bash" # enable pnpm support # export VOLTA_FEATURE_PNPM=1 diff --git a/dot/.xprofile b/dot/.xprofile index 605420f..7e9d4bd 100644 --- a/dot/.xprofile +++ b/dot/.xprofile @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/bash #xrandr --output HDMI-1 --same-as LVDS-1 @@ -38,14 +38,23 @@ fcitx5 -d #sudo service shadowsocks.client start # emacs --daemon -export PATH="~/.local/bin${PATH:+:}$PATH" -# pnpm -export PATH="~/.local/share/pnpm${PATH:+:}$PATH" -# pnpm end +# shell environment setup +export PATH="${HOME}/.local/bin${PATH:+:}$PATH" -# rust cargo -export PATH="~/.cargo/bin${PATH:+:}$PATH" -if [[ -e "$HOME/.cargo/env" ]]; then - . "$HOME/.cargo/env" +for _ in ${HOME}/.bashrc.d/manager/*; do + if [[ $_ == *.@(bash|sh) && -r $_ ]]; then + echo "$_" + source "$_" + fi +done + +if [[ -n "$(type -t mise-activate)" ]]; then + mise-activate fi -# rust cargo end + +for _ in ${HOME}/.bashrc.d/*; do + echo "$_" + if [[ $_ == *.@(bash|sh) && -r $_ ]]; then + source "$_" + fi +done