From b9582abdee3074ddf0d5fb9d028c4b6096cc23c2 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 5 Jul 2025 16:43:49 -0400 Subject: Update install script to download tpm and initialize plugins --- install.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'install.sh') diff --git a/install.sh b/install.sh index cec3281..8a08e51 100755 --- a/install.sh +++ b/install.sh @@ -26,6 +26,11 @@ main() { stow tmux stow ghostty echo "Successfully linked all dotfiles." + + echo "Initializing TPM (Tmux Plugin Manager)..." + setup_tpm + + echo "Setup complete!" } # Prompt the user for confirmation on an action. @@ -63,4 +68,34 @@ install_homebrew() { fi } +setup_tpm() { + local tpm_dir="$HOME/.config/tpm/plugins/tpm" + if [[ ! -d "$tpm_dir" ]]; then + echo "Cloning TPM..." + git clone https://github.com/tmux-plugins/tpm "$tpm_dir" + else + echo "TPM already exists, updating..." + (cd "$tpm_dir" && git pull) + fi + + if command -v tmux >/dev/null 2>&1; then + echo "Installing tmux plugins..." + # Start a tmux server in the background and install plugins + tmux start-server + tmux new-session -d -s tpm_install + tmux send-keys -t tpm_install "$tpm_dir/scripts/install_plugins.sh" Enter + + # Wait a moment for plugins to install + sleep 3 + + # Kill the temporary session + tmux kill-session -t tpm_install 2>/dev/null || true + + echo "TPM plugins installed successfully." + else + echo "Warning: tmux not found. TPM cloned but plugins not installed." + echo "Run 'tmux' and then press 'prefix + I' to install plugins manually." + fi +} + main -- cgit v1.2.3