summaryrefslogtreecommitdiff
path: root/.profile
blob: 01327915276ca1a7225f109e529bf92502335e2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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