summaryrefslogtreecommitdiff
path: root/dotfiles/common/.profile
blob: b4da79de5dc32857d25dcdc3f7545934edbee616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# .profile
# Craig Jennings <c@cjennings.net>
#
# Environment variables only. POSIX sh compatible.
# Sourced by login shells. Aliases and functions go in .bashrc/.zshrc.

# Tramp compatibility - simplify prompt for Emacs remote editing
if [ "$TERM" = "tramp" ] || [ "$TERM" = "dumb" ]; then
    PS1='$ '
    return 0 2>/dev/null || exit 0
fi

# =============================================================================
# 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

# =============================================================================
# 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/.deno/bin" ] && PATH="$PATH:$HOME/.deno/bin"
export PATH="$PATH:$HOME/.local/bin:/usr/sbin"

# =============================================================================
# Default Applications
# =============================================================================
export ALTERNATE_EDITOR=""
export EDITOR="emacsclient -c -a ''"
export VISUAL="emacsclient -c -a ''"
export SUDO_EDITOR="vi"
export BROWSER="google-chrome-stable"
export ALTBROWSER="firefox"

# =============================================================================
# Terminal (X11 defaults - overridden by hyprland.sh for Wayland)
# =============================================================================
export COLORTERM=truecolor
export TERM="st-256color"
export TERMINAL="st"

# =============================================================================
# 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"
    mkdir -p "$XDG_RUNTIME_DIR"
    chmod 0700 "$XDG_RUNTIME_DIR"
fi

# Desktop defaults (X11 - overridden by hyprland.sh for Wayland)
export XDG_CURRENT_DESKTOP=dwm
export XDG_SESSION_TYPE=x11

# =============================================================================
# GPG
# =============================================================================
export GPG_TTY="$(tty)"

# =============================================================================
# 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