dotfiles/.config/shell/start.sh

50 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/sh
# Common startup shell script
# Don't re-run this script
# [ -n "$E_STARTED" ] || . $HOME/.config/shell/start.sh
export E_SCRIPTS_DIR="$HOME/.config/shell"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_USER_CONFIG_DIR="$XDG_CONFIG_HOME"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
# Make nix's desktop files show up
# export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS"
export LANG=en_CA.UTF-8
# TZ
export EDITOR=nvim
# functions to add directories to $PATH
path_add(){
PATH="$1:$PATH"
}
path_add_end(){
PATH="$PATH:$1"
}
# Avoid having too many things in ~/ -----------------------
path_add "$HOME/.local/bin"
path_add "$HOME/.config/shell/bin"
# Rust, cargo
export CARGO_HOME="$XDG_DATA_HOME/cargo"
[ -f $CARGO_HOME/env ] && . "$CARGO_HOME/env"
# golang
export GOPROXY=direct
export GOPATH="$XDG_DATA_HOME/go"
path_add "$GOPATH/bin"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export PATH # just in case
# Note that this script has been run
export E_STARTED=1