Simplifies install and import scripts.

This commit is contained in:
2026-09-03 16:00:03 -07:00
parent 9f27d8a2c4
commit 56aca8a094
8 changed files with 213 additions and 72 deletions

44
.init_profile Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env sh
## Source all scripts in ~/.rc.d
if [ -d "$HOME/.rc.d" ]; then
for f in "$HOME/.rc.d"/*.sh; do
if [ -r "$f" ]; then
. "$f"
fi
done
# Source shell-specific scripts if any
if [ -n "$BASH_VERSION" ]; then
for f in "$HOME/.rc.d"/*.bash; do
if [ -r "$f" ]; then
. "$f"
fi
done
elif [ -n "$ZSH_VERSION" ]; then
for f in "$HOME/.rc.d"/*.zsh; do
if [ -r "$f" ]; then
. "$f"
fi
done
fi
fi
## Autocompletion (Bash)
if [ -n "$BASH_VERSION" ]; then
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
fi
## Paths
# Prepend common personal bin directories to path
if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH"; fi
if [ -d "$HOME/.bin" ] ; then PATH="$HOME/.bin:$PATH"; fi
if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH"; fi
if [ -d "$HOME/Applications/bin" ] ; then PATH="$HOME/Applications/bin:$PATH"; fi
export PATH