feat: re-organise files dir

This commit is contained in:
2026-02-13 14:59:25 +00:00
parent 6461654bff
commit faf3bf2dfc
13 changed files with 3 additions and 5 deletions

30
home/.profile Normal file
View File

@@ -0,0 +1,30 @@
# Environment
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export WORKSPACE="${WORKSPACE:-$HOME/Workspace}"
if [[ -n "${CODESPACES:-}" ]]; then
export DOTFILES="${DOTFILES:-/workspaces/.codespaces/.persistedshare/dotfiles}"
else
export DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
fi
export EDITOR=vim
export VISUAL=vim
export PAGER=less
# Homebrew
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_ENV_HINTS=1
# PATH setup with caching
_dots_path_cache="${XDG_CACHE_HOME:-$HOME/.cache}/dots/path"
if [[ -f "$_dots_path_cache" && "$_dots_path_cache" -nt ~/.profile ]]; then
export PATH="$(cat "$_dots_path_cache")"
else
[[ ":$PATH:" != *":$HOME/.local/bin:"* ]] && export PATH="$HOME/.local/bin:$PATH"
[[ -x "/opt/homebrew/bin/brew" && ":$PATH:" != *":/opt/homebrew/bin:"* ]] && export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
# Cache the result
mkdir -p "$(dirname "$_dots_path_cache")"
echo "$PATH" > "$_dots_path_cache"
fi
unset _dots_path_cache