about summary refs log tree commit diff stats
path: root/profile
blob: 3625f86e2c0d915feb03f0693f200fd58ebf9a72 (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
# ~/.profile -*- sh -*-

. /etc/profile

# History
mkdir -p ~/.history
export HISTFILE=~/.history/sh
export HISTSIZE=1000000000000

# Environment variables
export ENV="$HOME/.shrc"
export PATH="$HOME/bin:$PATH"
export LC_ALL=en_US.UTF-8
export CDPATH=:~
export SUDO=/usr/bin/doas
export EXINIT='set ai ic sm ts=8'
export MISC="$HOME/.misc"
export EDITOR="$(which ed)"
export VISUAL="$(which vi)"

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"

export XDG_DESKTOP_DIR="$HOME/"
export XDG_DOCUMENTS_DIR="$HOME/doc"
export XDG_DOWNLOAD_DIR="$HOME/tmp"
export XDG_MUSIC_DIR="$HOME/music"
export XDG_PICTURES_DIR="$HOME/img"
export XDG_PUBLICSHARE_DIR="$HOME/.local/share/public"
export XDG_TEMPLATES_DIR="$HOME/.local/templates"
export XDG_VIDEOS_DIR="$HOME/video"

if test -z "$XDG_RUNTIME_DIR"
then export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir
fi
if ! test -d "$XDG_RUNTIME_DIR"
then
	mkdir "$XDG_RUNTIME_DIR"
	chmod 0700 "$XDG_RUNTIME_DIR"
fi

installedp() { which "$1" >/dev/null 2>&1; }

# SSH
if installedp keychain
then eval $(keychain --quiet --eval --dir "$XDG_RUNTIME_DIR/" --agents ssh)
elif installedp ssh-agent
then eval $(ssh-agent -s)
fi

# RLWRAP
if installedp rlwrap
then export RLWRAP_HOME=$XDG_DATA_HOME/rlwrap
fi

# Start X on login
# if test /dev/tty1 = "$(tty)" && test -z "$DISPLAY"
# then startx
# fi