97 lines
2.3 KiB
Bash
97 lines
2.3 KiB
Bash
# ~/.profile
|
|
|
|
# if running bash
|
|
if [ -n "$BASH_VERSION" ]; then
|
|
# include .bashrc if it exists
|
|
if [ -f "$HOME/.bashrc" ]; then
|
|
. "$HOME/.bashrc"
|
|
fi
|
|
fi
|
|
|
|
# set PATH so it includes user's private bin if it exists
|
|
if [ -d "$HOME/bin" ]; then
|
|
PATH="$HOME/bin:$PATH"
|
|
fi
|
|
|
|
# set PATH so it includes user's private bin if it exists
|
|
if [ -d "$HOME/.local/bin" ]; then
|
|
PATH="$HOME/.local/bin:$PATH"
|
|
fi
|
|
|
|
# xdg base directory specification
|
|
export XDG_DATA_HOME=$HOME/.local/share
|
|
export XDG_CONFIG_HOME=$HOME/.config
|
|
export XDG_STATE_HOME=$HOME/.local/state
|
|
export XDG_DATA_DIRS=/usr/local/share:/usr/share
|
|
export XDG_CONFIG_DIRS=/etc/xdg
|
|
export XDG_CACHE_HOME=$HOME/.cache
|
|
|
|
# .bash_history
|
|
export HISTFILE=$XDG_STATE_HOME/bash/history
|
|
if [ ! -d "$(dirname "${HISTFILE}")" ]; then
|
|
mkdir -p "$(dirname "${HISTFILE}")"
|
|
fi
|
|
|
|
# mysql
|
|
export MYSQL_HISTFILE=$XDG_STATE_HOME/mysql/history
|
|
if [ ! -d "$(dirname "${MYSQL_HISTFILE}")" ]; then
|
|
mkdir -p "$(dirname "${MYSQL_HISTFILE}")"
|
|
fi
|
|
|
|
# wget
|
|
export WGETRC=$XDG_CONFIG_HOME/wget/wgetrc
|
|
if [ ! -f "${WGETRC}" ]; then
|
|
mkdir -p "$(dirname "${WGETRC}")"
|
|
printf %s\\n "hsts-file = ${XDG_CACHE_HOME}/wget-hsts" >>"${WGETRC}"
|
|
fi
|
|
|
|
# readline
|
|
export INPUTRC=$XDG_CONFIG_HOME/readline/inputrc
|
|
|
|
# screen
|
|
export SCREENRC=$XDG_CONFIG_HOME/screen/screenrc
|
|
|
|
# gnupg
|
|
export GNUPGHOME=$XDG_CONFIG_HOME/gnupg
|
|
|
|
# node
|
|
export NODE_REPL_HISTORY=$XDG_DATA_HOME/node_repl_history
|
|
|
|
# npm
|
|
export npm_config_userconfig=$XDG_CONFIG_HOME/npm/npmrc
|
|
export npm_config_prefix=$XDG_DATA_HOME/npm
|
|
export npm_config_cache=$XDG_CACHE_HOME/npm
|
|
export npm_config_init_module=$XDG_DATA_HOME/npm/config/npm-init.js
|
|
|
|
# python
|
|
export PYTHONSTARTUP=$XDG_CONFIG_HOME/python/pythonrc.py
|
|
export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python
|
|
export PYTHONUSERBASE=$XDG_DATA_HOME/python
|
|
export PYTHONHISTFILE=$XDG_STATE_HOME/python/history
|
|
|
|
# tex
|
|
export TEXMFHOME=$XDG_DATA_HOME/texmf
|
|
export TEXMFVAR=$XDG_CACHE_HOME/texlive/texmf-var
|
|
export TEXMFCONFIG=$XDG_CONFIG_HOME/texlive/texmf-config
|
|
|
|
# opam
|
|
export OPAMROOT=$XDG_DATA_HOME/opam
|
|
|
|
# editor
|
|
export EDITOR=vi
|
|
|
|
# desktop
|
|
if [ "$(tty)" = "/dev/tty1" ] && command -v sway >/dev/null; then
|
|
# locale
|
|
export LANG=sl_SI.UTF-8
|
|
export LC_MESSAGES=en_US.UTF-8
|
|
# defaults
|
|
export EDITOR=nvim
|
|
export VISUAL=nvim
|
|
export TERMINAL=footclient
|
|
export BROWSER=firefox
|
|
# run sway
|
|
export XDG_CURRENT_DESKTOP=sway
|
|
exec sway >/tmp/sway.log 2>&1
|
|
fi
|