mirror of
https://github.com/autistic-symposium/shell-whiz-toolkit.git
synced 2025-12-09 21:26:30 -05:00
add things resources from the last 5 years over machines
This commit is contained in:
parent
ac9c955e0b
commit
b0a4e417ee
77 changed files with 2327 additions and 84 deletions
43
tmux/tmux-config/install.sh
Executable file
43
tmux/tmux-config/install.sh
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
is_app_installed() {
|
||||
type "$1" &>/dev/null
|
||||
}
|
||||
|
||||
REPODIR="$(cd "$(dirname "$0")"; pwd -P)"
|
||||
cd "$REPODIR";
|
||||
|
||||
if ! is_app_installed tmux; then
|
||||
printf "WARNING: \"tmux\" command is not found. \
|
||||
Install it first\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e "$HOME/.tmux/plugins/tpm" ]; then
|
||||
printf "WARNING: Cannot found TPM (Tmux Plugin Manager) \
|
||||
at default location: \$HOME/.tmux/plugins/tpm.\n"
|
||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||
fi
|
||||
|
||||
if [ -e "$HOME/.tmux.conf" ]; then
|
||||
printf "Found existing .tmux.conf in your \$HOME directory. Will create a backup at $HOME/.tmux.conf.bak\n"
|
||||
fi
|
||||
|
||||
cp -f "$HOME/.tmux.conf" "$HOME/.tmux.conf.bak" 2>/dev/null || true
|
||||
cp -a ./tmux/. "$HOME"/.tmux/
|
||||
ln -sf .tmux/tmux.conf "$HOME"/.tmux.conf;
|
||||
|
||||
# Install TPM 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
|
||||
printf "Install TPM plugins\n"
|
||||
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 "OK: Completed\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue