1
0
mirror of https://github.com/samoshkin/tmux-config.git synced 2026-01-03 08:18:02 +00:00

Initial commit

This commit is contained in:
Alexey Samoshkin
2017-11-19 00:36:38 +02:00
commit 943be96ca9
6 changed files with 393 additions and 0 deletions

37
install.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
set -e
set -u
is_app_installed() {
type "$1" &>/dev/null
}
REPODIR="$(cd "$(dirname "$0")"; pwd -P)"
cd "$REPODIR";
git submodule update --recursive --init --quiet;
if ! is_app_installed tmux; then
printf "$(tput setaf 1)WARNING:$(tput sgr0) \"tmux\" command is not found. \
Install \"tmux\" yourself\n"
fi
# .tmux may already exist (created by tmux plugin manager)
rsync -aq --backup ./tmux/ "$HOME"/.tmux
if [ -e "$HOME/.tmux.conf" ]; then
printf "Found existing .tmux.conf in your \$HOME directory. Will backup it and overwrite with new .tmux.conf file? OK (y/n): "
read -r answer
if echo "$answer" | grep -iq "^n"; then
printf "Install config manually using command below:\n\n";
printf "\t cd && ln -sf .tmux/tmux.conf .tmux.conf\n";
exit 1;
fi
fi
ln -sf --backup=numbered .tmux/tmux.conf "$HOME"/.tmux.conf;
printf "$(tput setaf 2)OK:$(tput sgr0) Files are copied to \$HOME/.tmux and symlink at \$HOME/.tmux.conf is created\n"