summaryrefslogtreecommitdiff
path: root/.profile
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2023-06-05 13:22:20 -0400
committerSam Nystrom <sam@samnystrom.dev>2023-06-05 13:22:20 -0400
commit712355c61075ec32e3f739833093043e445a6600 (patch)
tree4305de843e2708b6c1ee14b487723a40e69b9d2e /.profile
parentc68cafbae276bece35fc34549227440c2b6de7d1 (diff)
.profile: don't add duplicate PATH entries
Diffstat (limited to '.profile')
-rw-r--r--.profile14
1 files changed, 13 insertions, 1 deletions
diff --git a/.profile b/.profile
index 3e0d7a8..22878f2 100644
--- a/.profile
+++ b/.profile
@@ -1,10 +1,22 @@
+
+# Add PATH entries, we can't use external commands yet in case PATH is empty
+for p in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/bin "$HOME"/.local/bin "$HOME"/.cargo/bin "$HOME"/bin; do
+ case ":$PATH:" in
+ *:"$p":*) ;;
+ *) export PATH="$PATH:$p" ;;
+ esac
+done
+
+# Create a tmpdir for XDG_RUNTIME_DIR if it is not set
+[ -z "$XDG_RUNTIME_DIR" ] && export XDG_RUNTIME_DIR=$(mktemp -d)
+
+# Set environment variables
export EDITOR=hx
export PAGER=less
export TERMINAL=foot
export BROWSER=firefox
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR"/hissh-agent
export DBUS_SESSION_BUS_ADDRESS=unix:path="$XDG_RUNTIME_DIR"/bus
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:"$HOME"/bin:"$HOME"/.local/bin:"$PATH"
export FZF_DEFAULT_OPTS=" \
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \