summaryrefslogtreecommitdiff
path: root/.profile
blob: 4bed3eacf168990876f9b62cc7ed2478dd1d5155 (plain) (blame)
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
#!/usr/bin/env sh

# Custom ENV variable - the home of the dotfiles.
export DOTFILESDIR="$HOME/.dotfiles"

# set PATH so it includes user's private bin if it exists.
[ -d "$DOTFILESDIR/bin" ] && PATH="$(find -H "$DOTFILESDIR/bin" -maxdepth 1 -type d -printf %p:)$PATH"
[ -d "$HOME/.local/bin" ] && PATH="$(find -H "$HOME/.local/bin" -maxdepth 1 -type d -printf %p:)$PATH"
[ -d "$HOME/bin" ] && PATH="$(find -H "$HOME/bin" -maxdepth 1 -type d -printf %p:)$PATH"

# Read zshrc from there.
export ZDOTDIR="$DOTFILESDIR/zsh"

# Set XDG_CONFIG_HOME.
export XDG_CONFIG_HOME="$DOTFILESDIR/config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"

# Some default programs.
export VISIUAL="nvim"
export EDITOR="nvim"
export MANPAGER="nvim +Man!"
export PDFVIEWER="zathura"
export BROWSER="linkhandler"
export TERMINAL="st"

# Check whether this is an ssh session.
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
  export SESSION_TYPE=remote/ssh
# many other tests omitted
else
  case $(ps -o comm= -p $PPID) in
    sshd|*/sshd) export SESSION_TYPE=remote/ssh;;
  esac
fi


# Some environment variable settings for some programs.

export MAILDIR="$XDG_DATA_HOME/mail"
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
# Pipenv.
export PIPENV_VENV_IN_PROJECT=1
# Go.
export GOPATH="$HOME/.local/share/go"
export GOBIN="$HOME/.local/bin/go"
# Node.
export NVM_DIR="${XDG_DATA_HOME}/nvm"
# Mbsync.
export MBSYNCRC="${XDG_CONFIG_HOME}/mbsync/config"
# GnuPG.
export GNUPGHOME="${XDG_DATA_HOME}/gnupg"
# Pass.
export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/password-store"
# Gnu Info.
# export INFOPATH="$XDG_DATA_HOME/info:$INFOPATH"

# Also source private profile.
[ -f "$DOTFILESDIR/general/profile.private" ] && . "$DOTFILESDIR/general/profile.private"