diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-26 16:57:37 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-26 16:57:37 -0600 |
| commit | 7d490453085ae084ce0e3875952eae1d3ad7b1ab (patch) | |
| tree | d6f76ded02d541107271dc2b04cac34435c81a26 /dotfiles/system/.profile | |
| parent | feb8dfaae9b0172c9d24e7e0d115754a467b4627 (diff) | |
refactor(shell): reorganize shell config for proper separation
Restructure shell configuration to follow standard conventions:
- .profile: Environment variables only (POSIX compatible)
- .bash_profile: NEW - sources .profile and .bashrc for login shells
- .bashrc: Bash-specific settings, sources .bashrc.d/
- .zshrc: Zsh-specific settings, sources .zshrc.d/
New modular directories:
- .bashrc.d/: aliases, emacs, fzf, git, media, utilities
- .zshrc.d/: same as bashrc.d plus arch-downgrade (zsh-only)
- .profile.d/: reduced to env-only files (display, framework, auto-tmux)
Fixes:
- Remove duplicate .profile sourcing in .bashrc
- Remove broken XDG_CURRENT_DESKTOP=GNOME line from display.sh
- Move aliases/functions from .profile to appropriate .d/ directories
- Shell-specific init (zoxide, fzf) now in .bashrc/.zshrc directly
- FreeBSD bindkey fix now in .zshrc directly
Also adds CLAUDE.md session context file.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'dotfiles/system/.profile')
| -rw-r--r-- | dotfiles/system/.profile | 160 |
1 files changed, 52 insertions, 108 deletions
diff --git a/dotfiles/system/.profile b/dotfiles/system/.profile index 8e7653c..b4da79d 100644 --- a/dotfiles/system/.profile +++ b/dotfiles/system/.profile @@ -1,137 +1,81 @@ # .profile # Craig Jennings <c@cjennings.net> +# +# Environment variables only. POSIX sh compatible. +# Sourced by login shells. Aliases and functions go in .bashrc/.zshrc. -# if connecting via Emacs tramp, simplify prompt for easy identification. -# keeping this statement at the top of the file prevent PS1 modifications +# Tramp compatibility - simplify prompt for Emacs remote editing if [ "$TERM" = "tramp" ] || [ "$TERM" = "dumb" ]; then PS1='$ ' + return 0 2>/dev/null || exit 0 fi -## -## ENVIRONMENT VARIABLES -## - +# ============================================================================= # Locale +# ============================================================================= export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 -# General -export LANGUAGE=en_US -export GPG_TTY="$(tty)" - +# ============================================================================= # Path -[ -d "$HOME/.local/share/gem/ruby/3.4.0/bin" ]; PATH="$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin" -[ -d "$HOME/.cargo/bin" ]; PATH="$PATH:$HOME/.cargo/bin" +# ============================================================================= +[ -d "$HOME/.local/share/gem/ruby/3.4.0/bin" ] && PATH="$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin" +[ -d "$HOME/.cargo/bin" ] && PATH="$PATH:$HOME/.cargo/bin" +[ -d "$HOME/.deno/bin" ] && PATH="$PATH:$HOME/.deno/bin" export PATH="$PATH:$HOME/.local/bin:/usr/sbin" -# Editor +# ============================================================================= +# Default Applications +# ============================================================================= export ALTERNATE_EDITOR="" export EDITOR="emacsclient -c -a ''" -export SUDO_EDITOR="$(which vi)" - -# Browser -export ALTBROWSER="$(which firefox)" -export BROWSER="$(which google-chrome-stable)" -# export BROWSER="$(which librewolf)" +export VISUAL="emacsclient -c -a ''" +export SUDO_EDITOR="vi" +export BROWSER="google-chrome-stable" +export ALTBROWSER="firefox" -# Terminal +# ============================================================================= +# Terminal (X11 defaults - overridden by hyprland.sh for Wayland) +# ============================================================================= export COLORTERM=truecolor -#export TERM="vt100" export TERM="st-256color" -export TERMINAL="$(which st)" -export VISUAL="emacsclient -c -a ''" +export TERMINAL="st" -# XDG -export XDG_CONFIG_HOME="$HOME/.config/" -export XDG_CURRENT_DESKTOP=dwm -export XDG_SESSION_TYPE=x11 -export XDG_DATA_DIRS="$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share:/usr/share" +# ============================================================================= +# XDG Base Directories +# ============================================================================= +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share" + +# XDG_RUNTIME_DIR fallback (usually set by systemd/pam) if [ -z "$XDG_RUNTIME_DIR" ]; then export XDG_RUNTIME_DIR="$HOME/.local/xdg/runtime" - if [ ! -d "$XDG_RUNTIME_DIR" ]; then - mkdir -p "$XDG_RUNTIME_DIR" - chmod 0700 "$XDG_RUNTIME_DIR" - fi + mkdir -p "$XDG_RUNTIME_DIR" + chmod 0700 "$XDG_RUNTIME_DIR" fi -# INFO -export INFOPATH=/home/cjennings/.emacs.d/assets/info: - - -## -## ALIASES -## - -# change to specific directory -alias cdot="cd ~/code/archsetup/dotfiles" -alias cdpf="cd ~/projects/finances/" -alias cdpj="cd ~/projects/jr-estate/" -alias cdpd="cd ~/projects/documents/" - -# general software aliases -alias crm="tickrs -s CRM" -alias handbrake="ghb" -alias linkdel="find . -type l ! -exec test -d {} \; -delete" -alias linkfind="find . -type l ! -exec test -d {} \; -print" -alias smerge="/usr/bin/smerge" -alias steam="flatpak run com.valvesoftware.Steam" -alias stext="/opt/sublime_text/sublime_text" -alias stow="stow --target=/home/cjennings" # required as dotfiles are in non-standard location -alias sysupgrade="topgrade" -alias vim="nvim" -alias et="emacs -nw" -alias weather="wego" -alias whereami="curl ipinfo.io" -alias xterm="xterm -ti 340" - -# claude code -alias hey='claude "Read ./docs/protocols.org and ./docs/NOTES.org, follow their instructions, then run session startup workflow."' - -# general utility -# alias mount="sudo mount -o uid=$(id -u),gid=$(id -g),umask=0022 " -alias backup='sudo rsyncshot backup 1000' -alias boot2bios="sudo systemctl reboot --firmware-setup" -alias df='dfc -p /dev/' -alias ducks='du -cksh * | sort -rh | head -n11' -alias ls="exa --group-directories-first " -alias l="exa -lhF --group-directories-first " -alias ll="exa -lhAF --group-directories-first " -alias lt="exa -lthAF --group-directories-first " -alias mkd="mkdir -pv" -alias myip='curl -4 https://chroot-me.in/ip/ 2> /dev/null || w3m -4 -dump https://chroot-me.in/ip' -alias open="xdg-open" -alias ntop="sudo bandwhich" -alias ptop="sudo powertop" -alias running_services='systemctl list-units --type=service --state=running' -alias speedtest="speedtest-go" -alias ssn="sudo shutdown now" -alias sysinfo='sudo inxi -v 8 -a -xxxA -xxxB -xxxC -xxxD -xxxG -xxxI -xxxm -xxxN -xxxR -xxxS -xxx --usb -d -I -pl -n -s --slots ' -alias timeshift='sudo timeshift-gtk' - -# programming -alias cc="gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion -Wextra -std=c2x -pedantic" -alias gdbx="gdb --batch --ex r --ex bt --ex q --args" +# Desktop defaults (X11 - overridden by hyprland.sh for Wayland) +export XDG_CURRENT_DESKTOP=dwm +export XDG_SESSION_TYPE=x11 -# ranger -# when exiting ranger, leave the prompt at the destination -alias cdr='. ranger' -alias r='. ranger' +# ============================================================================= +# GPG +# ============================================================================= +export GPG_TTY="$(tty)" -# source sh files in .profile.d -PROFILE_D="$HOME/.profile.d/" -if [ -d "$PROFILE_D" ]; then - for file in $(find "$PROFILE_D" -name "*.sh"); do - source "$file" - done +# ============================================================================= +# Emacs Info Path +# ============================================================================= +export INFOPATH="$HOME/.config/emacs/info:/usr/share/info:/usr/local/share/info" + +# ============================================================================= +# Source modular environment files from .profile.d/ +# ============================================================================= +if [ -d "$HOME/.profile.d" ]; then + for file in "$HOME/.profile.d"/*.sh; do + [ -r "$file" ] && . "$file" + done + unset file fi - -# launch x automatically -# if [ -z "$DISPLAY" ] && [ "$(tty)" = /dev/tty1 ]; then -# startx -# fi -# Phenomenology RAG alias - queries cogito with deepseek-r1:70b -phenom() { - aichat --rag phenom -m ollama:deepseek-r1:70b "$@" -} |
