diff options
Diffstat (limited to '.profile')
| -rw-r--r-- | .profile | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.profile b/.profile new file mode 100644 index 0000000..0132791 --- /dev/null +++ b/.profile @@ -0,0 +1,23 @@ +#!/bin/sh + +# Add PATH entries if they aren't already in PATH +# We can't use external commands yet in case PATH is empty +for p in /command /bin /sbin /usr/bin /usr/sbin /var/lib/flatpak/exports/bin /usr/local/bin /usr/local/sbin ~/.local/bin ~/.cargo/bin ~/bin; do + case ":$PATH:" in + *:"$p":*) ;; + *) export PATH="$p:$PATH" ;; + esac +done + +# Create a tmpdir for XDG_RUNTIME_DIR if it is not set +if [ -z "$XDG_RUNTIME_DIR" ]; then + rundir="/run/user/$(id -u)" + if [ -d "$rundir" ]; then + export XDG_RUNTIME_DIR="$rundir" + else + export XDG_RUNTIME_DIR="$(mktemp -d)" + fi +fi + +export ENV=~/.ashrc +. $ENV |
