-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_30-tmux.tmpl
31 lines (27 loc) · 1.16 KB
/
run_once_30-tmux.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Id: run_once_30-tmux.tmpl 1.0.0 (2021/02/13)
# Author: Gionni <[email protected]>
# Desc: Addon script for chezmoi <https://github.com/twpayne/chezmoi>
# Customise tmux
# ----------------------------------------------------------------------
# Variable declaration section.
# ----------------------------------------------------------------------
readonly TMUX_PLUGINS_REPOS=(
https://github.com/tmux-plugins/tpm.git
)
# ---------------------------------------------------------------------- #
readonly GIT_OPTS="--quiet"
readonly TMUX_PLUGINDIR="${HOME}/.tmux/plugins"
# ----------------------------------------------------------------------
# Functions and main code - Do not modify below.
# ----------------------------------------------------------------------
function install_tmux_plugins () {
for PLUGIN in ${TMUX_PLUGINS_REPOS[@]} ; do
export PLUGIN_NAME=$(echo ${PLUGIN%.*} | rev | cut -d/ -f1 | rev)
if [[ ! -d "${TMUX_PLUGINDIR}/${PLUGIN_NAME}" ]] ; then
printf "[**] Installing TMUX plugin: ${PLUGIN}\n"
git clone ${GIT_OPTS} ${PLUGIN} ${TMUX_PLUGINDIR}/${PLUGIN_NAME}
fi
done
}
install_tmux_plugins