aboutsummaryrefslogtreecommitdiff
path: root/plugins/tpm/bindings
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2017-02-13 09:54:26 -0700
committerCody Hiar <codyfh@gmail.com>2017-02-13 09:54:26 -0700
commit783ab79ab721593b0ac85ab4d8ea9b74fa5fe72e (patch)
tree03ac1d680ab401874ed95a78887c56d6eb268a61 /plugins/tpm/bindings
parent2eede125238144e9d37cf856aaaeda3c5de5aab3 (diff)
Adding tpm
Diffstat (limited to 'plugins/tpm/bindings')
-rwxr-xr-xplugins/tpm/bindings/clean_plugins19
-rwxr-xr-xplugins/tpm/bindings/install_plugins19
-rwxr-xr-xplugins/tpm/bindings/update_plugins49
3 files changed, 87 insertions, 0 deletions
diff --git a/plugins/tpm/bindings/clean_plugins b/plugins/tpm/bindings/clean_plugins
new file mode 100755
index 0000000..9a0d5d7
--- /dev/null
+++ b/plugins/tpm/bindings/clean_plugins
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+# Tmux key-binding script.
+# Scripts intended to be used via the command line are in `bin/` directory.
+
+CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+SCRIPTS_DIR="$CURRENT_DIR/../scripts"
+HELPERS_DIR="$SCRIPTS_DIR/helpers"
+
+source "$HELPERS_DIR/tmux_echo_functions.sh"
+source "$HELPERS_DIR/tmux_utils.sh"
+
+main() {
+ reload_tmux_environment
+ "$SCRIPTS_DIR/clean_plugins.sh" --tmux-echo >/dev/null 2>&1
+ reload_tmux_environment
+ end_message
+}
+main
diff --git a/plugins/tpm/bindings/install_plugins b/plugins/tpm/bindings/install_plugins
new file mode 100755
index 0000000..3ade3c4
--- /dev/null
+++ b/plugins/tpm/bindings/install_plugins
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+# Tmux key-binding script.
+# Scripts intended to be used via the command line are in `bin/` directory.
+
+CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+SCRIPTS_DIR="$CURRENT_DIR/../scripts"
+HELPERS_DIR="$SCRIPTS_DIR/helpers"
+
+source "$HELPERS_DIR/tmux_echo_functions.sh"
+source "$HELPERS_DIR/tmux_utils.sh"
+
+main() {
+ reload_tmux_environment
+ "$SCRIPTS_DIR/install_plugins.sh" --tmux-echo >/dev/null 2>&1
+ reload_tmux_environment
+ end_message
+}
+main
diff --git a/plugins/tpm/bindings/update_plugins b/plugins/tpm/bindings/update_plugins
new file mode 100755
index 0000000..28cc281
--- /dev/null
+++ b/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