summaryrefslogtreecommitdiff
path: root/dots/tmux/.tmux/plugins/tpm/bindings/update_plugins
diff options
context:
space:
mode:
authorElizabeth <me@liz.coffee>2025-06-02 13:11:10 -0700
committerElizabeth <me@liz.coffee>2025-06-02 13:11:10 -0700
commitd098e94ad102da9d018acca72ca5a5c554d25a01 (patch)
treed6d23ee63ad5a1aa4017a605d9e09e75de2c5f49 /dots/tmux/.tmux/plugins/tpm/bindings/update_plugins
parentede675866355d34ac9fdc1b8e047576f574bdfa2 (diff)
downloaddotfiles-d098e94ad102da9d018acca72ca5a5c554d25a01.tar.gz
dotfiles-d098e94ad102da9d018acca72ca5a5c554d25a01.zip
Update paths n stuff
Diffstat (limited to 'dots/tmux/.tmux/plugins/tpm/bindings/update_plugins')
-rwxr-xr-xdots/tmux/.tmux/plugins/tpm/bindings/update_plugins49
1 files changed, 49 insertions, 0 deletions
diff --git a/dots/tmux/.tmux/plugins/tpm/bindings/update_plugins b/dots/tmux/.tmux/plugins/tpm/bindings/update_plugins
new file mode 100755
index 0000000..28cc281
--- /dev/null
+++ b/dots/tmux/.tmux/plugins/tpm/bindings/update_plugins
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+# Tmux key-binding script.
+# Scripts intended to be used via the command line are in `bin/` directory.
+
+# This script:
+# - shows a list of installed plugins
+# - starts a prompt to enter the name of the plugin that will be updated
+
+CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+SCRIPTS_DIR="$CURRENT_DIR/../scripts"
+HELPERS_DIR="$SCRIPTS_DIR/helpers"
+
+source "$HELPERS_DIR/plugin_functions.sh"
+source "$HELPERS_DIR/tmux_echo_functions.sh"
+source "$HELPERS_DIR/tmux_utils.sh"
+
+display_plugin_update_list() {
+ local plugins="$(tpm_plugins_list_helper)"
+ tmux_echo "Installed plugins:"
+ tmux_echo ""
+
+ for plugin in $plugins; do
+ # displaying only installed plugins
+ if plugin_already_installed "$plugin"; then
+ local plugin_name="$(plugin_name_helper "$plugin")"
+ tmux_echo " $plugin_name"
+ fi
+ done
+
+ tmux_echo ""
+ tmux_echo "Type plugin name to update it."
+ tmux_echo ""
+ tmux_echo "- \"all\" - updates all plugins"
+ tmux_echo "- ENTER - cancels"
+}
+
+update_plugin_prompt() {
+ tmux command-prompt -p 'plugin update:' " \
+ send-keys C-c; \
+ run-shell '$SCRIPTS_DIR/update_plugin_prompt_handler.sh %1'"
+}
+
+main() {
+ reload_tmux_environment
+ display_plugin_update_list
+ update_plugin_prompt
+}
+main