81 lines
2.4 KiB
Bash
81 lines
2.4 KiB
Bash
# shellcheck shell=bash
|
|
# vim: ft=sh
|
|
|
|
# Запрет чтения настроек из системного каталога /etc
|
|
unsetopt GLOBAL_RCS
|
|
|
|
# PATH {{{
|
|
# Ruby
|
|
if command -v ruby >/dev/null && command -v gem >/dev/null; then
|
|
path=("$(ruby -r rubygems -e 'puts Gem.user_dir')/bin" $path)
|
|
fi
|
|
|
|
# Поиск в домашнем каталоге
|
|
path=("$HOME/bin" "$HOME/.local/bin" $path)
|
|
|
|
# Удалить дубликаты в массиве
|
|
typeset -aU path
|
|
# }}}
|
|
|
|
# Базовые каталоги {{{
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
|
export XDG_CACHE_HOME="$HOME/.cache"
|
|
export XDG_DATA_HOME="$HOME/.local/share"
|
|
export XDG_STATE_HOME="$HOME/.local/state"
|
|
# }}}
|
|
|
|
export ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
|
|
export ZSH_COMPDUMP="$ZSH_CACHE_DIR/zcompdump-${HOST/.*/}-$ZSH_VERSION"
|
|
|
|
# Короткое имя компьютера, обязательно нужно для ssh-agent.
|
|
# Часто используется в OhMyZsh.
|
|
export SHORT_HOST="${SHORT_HOST:-${(%):-%m}}"
|
|
|
|
# Отключаем некоторые плагины, если запуск в качестве подоболочки mc
|
|
# Bug: https://midnight-commander.org/ticket/4253
|
|
[ "$(ps -p $PPID -o cmd=)" = "mc" ] && ZSH_MC_SUBSHELL=1
|
|
|
|
# GnuPG
|
|
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
|
|
|
|
# askpass # {{{
|
|
if [[ -n ${DISPLAY+set} ]]; then
|
|
if command -v /usr/lib/openssh/gnome-ssh-askpass >/dev/null 2>&1; then
|
|
# Gnome
|
|
export SSH_ASKPASS=/usr/lib/openssh/gnome-ssh-askpass
|
|
elif command -v /usr/bin/lxqt-openssh-askpass >/dev/null 2>&1; then
|
|
# LxQt
|
|
export SSH_ASKPASS=/usr/bin/lxqt-openssh-askpass
|
|
elif command -v /usr/bin/ssh-askpass >/dev/null 2>&1; then
|
|
# X11
|
|
export SSH_ASKPASS=/usr/bin/ssh-askpass
|
|
fi
|
|
fi
|
|
# }}}
|
|
|
|
if command -v bat >/dev/null; then
|
|
export PAGER=bat
|
|
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
|
fi
|
|
|
|
# Uncrustify
|
|
export UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify/uncrustify.cfg"
|
|
[ ! -r "${UNCRUSTIFY_CONFIG}" ] && unset UNCRUSTIFY_CONFIG
|
|
|
|
# Intel OneAPI #{{{
|
|
if [[ -n ${ENABLE_INTEL_STUDIO+set} ]]; then
|
|
#export COMPILERVARS_ARCHITECTURE=intel64
|
|
#export COMPILERVARS_PLATFORM=linux
|
|
INTEL_VARS=( /opt/intel/oneapi/advisor/latest/advixe-vars.sh
|
|
/opt/intel/oneapi/compiler/latest/env/vars.sh
|
|
/opt/intel/oneapi/vtune/latest/vtune-vars.sh )
|
|
|
|
for f in "${INTEL_VARS[@]}"; do
|
|
if [ -r "$f" ]; then source "$f" >/dev/null; fi
|
|
done
|
|
fi
|
|
# }}}
|
|
|
|
[ -r "$ZDOTDIR/.zshenv.user" ] && source "$ZDOTDIR/.zshenv.user"
|
|
|