Make tmux & tpm XDG compliant.

This commit is contained in:
Marty Oehme 2019-02-25 00:38:18 +01:00
parent b3b6d91f33
commit 2da738f1a8
4 changed files with 13 additions and 5 deletions

View file

@ -73,4 +73,4 @@ set -g status-right "#{prefix_highlight} #[fg=colour235,bg=colour233]#[fg=col
set -g @plugin 'jimeh/tmux-themepack' set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/default/blue' set -g @themepack 'powerline/default/blue'
run -b '~/.tmux/plugins/tpm/tpm' run -b "${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm"

View file

@ -1,13 +1,20 @@
# Clone tmux plugin manager if not existing # Clone tmux plugin manager if not existing
if [[ -z "$TPM_PARENT_DIR" ]]; then if [[ -z "$TPM_PARENT_DIR" ]]; then
TPM_PARENT_DIR=$HOME TPM_PARENT_DIR=${XDG_CONFIG_DIR:-$HOME/.config}/tmux
fi fi
if [[ ! -f $TPM_PARENT_DIR/.tmux/plugins/tpm/tpm ]]; then
if [[ ! -f $TPM_PARENT_DIR/plugins/tpm/tpm ]]; then
if [[ ! -d "$TPM_PARENT_DIR" ]]; then if [[ ! -d "$TPM_PARENT_DIR" ]]; then
mkdir -p "$TPM_PARENT_DIR" mkdir -p "$TPM_PARENT_DIR"
fi fi
pushd $TPM_PARENT_DIR pushd $TPM_PARENT_DIR
git clone https://github.com/tmux-plugins/tpm ./.tmux/plugins/tpm git clone https://github.com/tmux-plugins/tpm plugins/tpm
popd popd
fi fi
export TMUX_PLUGIN_MANAGER_PATH=$TPM_PARENT_DIR/plugins
alias tmux="tmux -f ${TPM_PARENT_DIR}/tmux.conf"
unset TPM_PARENT_DIR unset TPM_PARENT_DIR
unset TPM_SUB_DIR

View file

@ -1,4 +1,5 @@
export XDG_CONFIG_DIR="$HOME/.config" export XDG_CONFIG_DIR="$HOME/.config"
export XDG_CONFIG_HOME=$XDG_CONFIG_DIR
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"

2
.zshrc
View file

@ -135,7 +135,7 @@ load_config_files $ZSH_CONFIG_DIR 3456789
# if [ -n "$(/bin/ls $ZSH_CONFIG_DIR/)" ]; then # if [ -n "$(/bin/ls $ZSH_CONFIG_DIR/)" ]; then
# GLOB=($ZSH_CONFIG_DIR/[:alpha:]*) # GLOB=($ZSH_CONFIG_DIR/[:alpha:]*)
# for dotfile in $GLOB; do # for dotfile in $GLOB; do
# print_dbg "Phase 4, Alphabetic: $dotfile\n" #//DEBUG # print_dbg "Alphabetic: $dotfile\n" #//DEBUG
# if [ -r "${dotfile}" ]; then # if [ -r "${dotfile}" ]; then
# source "${dotfile}" # source "${dotfile}"
# fi # fi