helm/shell/tmux/_init
2018-08-25 21:38:43 +02:00

39 lines
777 B
Bash
Executable file

#!/usr/bin/env zsh
source ${0:A:h}/../../deploy
source env.zsh
install() {
case $(_os) in
macos) brew install tmux ;;
arch) sudo pacman --needed --noconfirm -S tmux ;;
debian) sudo apt-get install -y tmux ;;
esac
[[ -n $TMUXIFIER ]] && _ensure_repo jimeh/tmuxifier $TMUXIFIER
_ensure_repo tmux-plugins/tpm $TMUX_PLUGINS_HOME/tpm
}
update() {
local tpm=$TMUX_PLUGINS_PATH/tpm
if [[ -d $tpm ]]; then
$tpm/bin/update_plugins all
$tpm/bin/clean_plugins all
fi
if [[ -d $TMUXIFIER ]]; then
cd $TMUXIFIER && git pull --rebase
fi
}
link() {
mklink tmux*.conf $TMUX_HOME/
mklink scripts $TMUX_HOME/scripts
mklink layouts $TMUXIFIER_LAYOUT_PATH
}
clean() {
rm -rfv $TMUX_HOME $TMUX_PLUGINS_HOME $TMUXIFIER
}
init "$@"