aboutsummaryrefslogtreecommitdiffstats
path: root/shlib/tmux.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-11-01 21:25:17 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-11-01 21:25:17 -0400
commitfe351483777c8d053d9f8b584278a4c2b162db0e (patch)
tree15af9419e315bfad090c940be4a61625bf785876 /shlib/tmux.sh
parentMove /usr/local/bin farther up the path (diff)
downloaddotfiles-fe351483777c8d053d9f8b584278a4c2b162db0e.zip
Update install scripts for macos and linux and use sh
Diffstat (limited to 'shlib/tmux.sh')
-rw-r--r--shlib/tmux.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/shlib/tmux.sh b/shlib/tmux.sh
new file mode 100644
index 0000000..c8870f5
--- /dev/null
+++ b/shlib/tmux.sh
@@ -0,0 +1,30 @@
+# shellcheck shell=sh
+[ -n "${DOTFILES_TMUX_LOADED}" ] && return
+readonly DOTFILES_TMUX_LOADED=1
+
+. "$(dirname "$0")/shlib/log.sh"
+
+tmux_setup_tpm() {
+ (
+ tpm_dir="$HOME/.config/tpm/plugins/tpm"
+ if [ ! -d "$tpm_dir" ]; then
+ log_info "Cloning TPM..."
+ if ! git clone https://github.com/tmux-plugins/tpm "$tpm_dir"; then
+ log_error "Failed to clone tpm to $tpm_dir"
+ return 1
+ fi
+ else
+ log_info "TPM already exists, updating..."
+ (cd "$tpm_dir" && git pull)
+ fi
+
+ if command -v tmux >/dev/null 2>&1; then
+ log_info "Installing tmux plugins..."
+ "$tpm_dir/scripts/install_plugins.sh"
+ log_info "TPM plugins installed successfully."
+ else
+ log_warn "tmux not found. TPM cloned but plugins not installed."
+ log_warn "Run 'tmux' and then press 'prefix + I' to install plugins manually."
+ fi
+ )
+}