mirror of
https://github.com/samoshkin/tmux-config.git
synced 2026-01-05 09:18:01 +00:00
Fix installation script so it can install tmux plugin manager and tmux plugins
This commit is contained in:
14
install.sh
14
install.sh
@@ -18,8 +18,8 @@ fi
|
|||||||
|
|
||||||
if [ ! -e "$HOME/.tmux/plugins/tpm" ]; then
|
if [ ! -e "$HOME/.tmux/plugins/tpm" ]; then
|
||||||
printf "$(tput setaf 1)WARNING:$(tput sgr0) Cannot found TPM (Tmux Plugin Manager) \
|
printf "$(tput setaf 1)WARNING:$(tput sgr0) Cannot found TPM (Tmux Plugin Manager) \
|
||||||
at default location: \$HOME/.tmux/plugins/tpm. Install it first\n"
|
at default location: \$HOME/.tmux/plugins/tpm.\n"
|
||||||
exit 1
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e "$HOME/.tmux.conf" ]; then
|
if [ -e "$HOME/.tmux.conf" ]; then
|
||||||
@@ -30,8 +30,13 @@ rsync -aq ./tmux/ "$HOME"/.tmux
|
|||||||
|
|
||||||
ln -sf --backup --suffix=.bak .tmux/tmux.conf "$HOME"/.tmux.conf;
|
ln -sf --backup --suffix=.bak .tmux/tmux.conf "$HOME"/.tmux.conf;
|
||||||
|
|
||||||
# BUG: Fix TPM and tmux plugins for fresh installation
|
# Install TPM plugins.
|
||||||
# "$HOME"/.tmux/plugins/tpm/bin/install_plugins
|
# TPM requires running tmux server, as soon as `tmux start-server` does not work
|
||||||
|
# create dump __noop session in detached mode, and kill it when plugins are installed
|
||||||
|
tmux new -d -s __noop >/dev/null 2>&1 || true
|
||||||
|
tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.tmux/plugins"
|
||||||
|
"$HOME"/.tmux/plugins/tpm/bin/install_plugins || true
|
||||||
|
tmux kill-session -t __noop >/dev/null 2>&1 || true
|
||||||
|
|
||||||
printf "$(tput setaf 2)OK:$(tput sgr0) Completed\n"
|
printf "$(tput setaf 2)OK:$(tput sgr0) Completed\n"
|
||||||
|
|
||||||
@@ -45,4 +50,3 @@ printf "$(tput setaf 2)OK:$(tput sgr0) Completed\n"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user