diff options
author | Robin Krahl <me@robin-krahl.de> | 2018-02-27 22:55:46 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2018-02-27 22:55:46 +0100 |
commit | ec6bec1983a8ecd2dc9f3fa075964be64cad3981 (patch) | |
tree | 4155efe0c5915dbb058e3abe1399ff719ddcd216 | |
parent | d5ff981fa61890c3df2997fd35f189e409476d0d (diff) | |
download | dotfiles-ec6bec1983a8ecd2dc9f3fa075964be64cad3981.tar.gz dotfiles-ec6bec1983a8ecd2dc9f3fa075964be64cad3981.tar.bz2 |
Modularize environment variables
-rw-r--r-- | bash/.config/env/90-bash.sh | 1 | ||||
-rw-r--r-- | cargo/.config/env/90-cargo.sh | 1 | ||||
-rw-r--r-- | elinks/.config/env/90-elinks.sh | 1 | ||||
-rw-r--r-- | gimp/.config/env/90-gimp.sh | 1 | ||||
-rw-r--r-- | less/.config/env/90-less.sh | 2 | ||||
-rw-r--r-- | notmuch/.config/env/90-notmuch.sh | 1 | ||||
-rw-r--r-- | npm/.config/env/90-npm.sh | 1 | ||||
-rw-r--r-- | pass/.config/env/90-pass.sh | 1 | ||||
-rw-r--r-- | sh/.config/env/00-xdg.sh | 3 | ||||
-rw-r--r-- | sh/.config/env/10-path.sh | 4 | ||||
-rw-r--r-- | sh/.config/sh/environment.sh | 20 | ||||
-rw-r--r-- | sh/.profile | 8 | ||||
-rw-r--r-- | vim/.config/env/90-vim.sh | 1 | ||||
-rw-r--r-- | vim/.config/vim/vimrc (renamed from vim/.vimrc) | 0 | ||||
-rw-r--r-- | x/.config/env/90-x.sh | 2 |
15 files changed, 25 insertions, 22 deletions
diff --git a/bash/.config/env/90-bash.sh b/bash/.config/env/90-bash.sh new file mode 100644 index 0000000..11887fa --- /dev/null +++ b/bash/.config/env/90-bash.sh @@ -0,0 +1 @@ +export HISTFILE="${XDG_CACHE_HOME}/sh/history" diff --git a/cargo/.config/env/90-cargo.sh b/cargo/.config/env/90-cargo.sh new file mode 100644 index 0000000..d37dba5 --- /dev/null +++ b/cargo/.config/env/90-cargo.sh @@ -0,0 +1 @@ +export CARGO_HOME="${XDG_DATA_HOME}/cargo" diff --git a/elinks/.config/env/90-elinks.sh b/elinks/.config/env/90-elinks.sh new file mode 100644 index 0000000..b40468a --- /dev/null +++ b/elinks/.config/env/90-elinks.sh @@ -0,0 +1 @@ +export ELINKS_CONFDIR="${XDG_CONFIG_HOME}/elinks" diff --git a/gimp/.config/env/90-gimp.sh b/gimp/.config/env/90-gimp.sh new file mode 100644 index 0000000..8c11b8c --- /dev/null +++ b/gimp/.config/env/90-gimp.sh @@ -0,0 +1 @@ +export GIMP2_DIRECTORY="${XDG_CONFIG_HOME}/gimp" diff --git a/less/.config/env/90-less.sh b/less/.config/env/90-less.sh new file mode 100644 index 0000000..e9db4d9 --- /dev/null +++ b/less/.config/env/90-less.sh @@ -0,0 +1,2 @@ +export LESSHISTFILE="${XDG_CACHE_HOME}/less/history" +export LESSKEY="${XDG_CONFIG_HOME}/less/lesskey" diff --git a/notmuch/.config/env/90-notmuch.sh b/notmuch/.config/env/90-notmuch.sh new file mode 100644 index 0000000..1a31463 --- /dev/null +++ b/notmuch/.config/env/90-notmuch.sh @@ -0,0 +1 @@ +export NOTMUCH_CONFIG="${XDG_CONFIG_HOME}/notmuch/config" diff --git a/npm/.config/env/90-npm.sh b/npm/.config/env/90-npm.sh new file mode 100644 index 0000000..1606093 --- /dev/null +++ b/npm/.config/env/90-npm.sh @@ -0,0 +1 @@ +export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME}/npm/config" diff --git a/pass/.config/env/90-pass.sh b/pass/.config/env/90-pass.sh new file mode 100644 index 0000000..ed0b68c --- /dev/null +++ b/pass/.config/env/90-pass.sh @@ -0,0 +1 @@ +export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/pass" diff --git a/sh/.config/env/00-xdg.sh b/sh/.config/env/00-xdg.sh new file mode 100644 index 0000000..51404c7 --- /dev/null +++ b/sh/.config/env/00-xdg.sh @@ -0,0 +1,3 @@ +export XDG_CONFIG_HOME="${HOME}/.config" +export XDG_CACHE_HOME="${HOME}/.cache" +export XDG_DATA_HOME="${HOME}/.local/share" diff --git a/sh/.config/env/10-path.sh b/sh/.config/env/10-path.sh new file mode 100644 index 0000000..67cb738 --- /dev/null +++ b/sh/.config/env/10-path.sh @@ -0,0 +1,4 @@ +if [ -d "${HOME}/bin" ] +then + export PATH="${PATH}:${HOME}/bin" +fi diff --git a/sh/.config/sh/environment.sh b/sh/.config/sh/environment.sh deleted file mode 100644 index f02296d..0000000 --- a/sh/.config/sh/environment.sh +++ /dev/null @@ -1,20 +0,0 @@ -export XDG_CONFIG_HOME="${HOME}/.config" -export XDG_CACHE_HOME="${HOME}/.cache" -export XDG_DATA_HOME="${HOME}/.local/share" - -if [ -d "${HOME}/bin" ] -then - export PATH="${PATH}:${HOME}/bin" -fi - -export CARGO_HOME="${XDG_DATA_HOME}/cargo" -export ELINKS_CONFDIR="${XDG_CONFIG_HOME}/elinks" -export GIMP2_DIRECTORY="${XDG_CONFIG_HOME}/gimp" -export HISTFILE="${XDG_CACHE_HOME}/sh/history" -export LESSHISTFILE="${XDG_CACHE_HOME}/less/history" -export LESSKEY="${XDG_CONFIG_HOME}/less/lesskey" -export NOTMUCH_CONFIG="${XDG_CONFIG_HOME}/notmuch/config" -export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME}/npm/config" -export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/pass" -export XAUTHORITY="${XDG_RUNTIME_DIR}/Xauthority" -export XINITRC="${XDG_CONFIG_HOME}/X11/xinitrc" diff --git a/sh/.profile b/sh/.profile index 399a6ba..36852bc 100644 --- a/sh/.profile +++ b/sh/.profile @@ -1,6 +1,10 @@ -if [ -f "${HOME}/.config/sh/environment.sh" ] +if [ -d "${HOME}/.config/env" ] then - . "${HOME}/.config/sh/environment.sh" + ENV_FILES=`find "${HOME}/.config/env" -type f,l -name "*.sh" | sort` + for ENV_FILE in ${ENV_FILES} + do + . ${ENV_FILE} + done fi if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] diff --git a/vim/.config/env/90-vim.sh b/vim/.config/env/90-vim.sh new file mode 100644 index 0000000..c1f3a31 --- /dev/null +++ b/vim/.config/env/90-vim.sh @@ -0,0 +1 @@ +export VIMINIT='source ${XDG_CONFIG_HOME}/vim/vimrc' diff --git a/vim/.vimrc b/vim/.config/vim/vimrc index c760f86..c760f86 100644 --- a/vim/.vimrc +++ b/vim/.config/vim/vimrc diff --git a/x/.config/env/90-x.sh b/x/.config/env/90-x.sh new file mode 100644 index 0000000..076ab5e --- /dev/null +++ b/x/.config/env/90-x.sh @@ -0,0 +1,2 @@ +export XAUTHORITY="${XDG_RUNTIME_DIR}/Xauthority" +export XINITRC="${XDG_CONFIG_HOME}/X11/xinitrc" |