aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh35
1 files changed, 35 insertions, 0 deletions
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