My configuration files for Debian/Ubuntu applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

50 lines
1.2 KiB

  1. #!/usr/bin/env bash
  2. # Tmux key-binding script.
  3. # Scripts intended to be used via the command line are in `bin/` directory.
  4. # This script:
  5. # - shows a list of installed plugins
  6. # - starts a prompt to enter the name of the plugin that will be updated
  7. CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  8. SCRIPTS_DIR="$CURRENT_DIR/../scripts"
  9. HELPERS_DIR="$SCRIPTS_DIR/helpers"
  10. source "$HELPERS_DIR/plugin_functions.sh"
  11. source "$HELPERS_DIR/tmux_echo_functions.sh"
  12. source "$HELPERS_DIR/tmux_utils.sh"
  13. display_plugin_update_list() {
  14. local plugins="$(tpm_plugins_list_helper)"
  15. tmux_echo "Installed plugins:"
  16. tmux_echo ""
  17. for plugin in $plugins; do
  18. # displaying only installed plugins
  19. if plugin_already_installed "$plugin"; then
  20. local plugin_name="$(plugin_name_helper "$plugin")"
  21. tmux_echo " $plugin_name"
  22. fi
  23. done
  24. tmux_echo ""
  25. tmux_echo "Type plugin name to update it."
  26. tmux_echo ""
  27. tmux_echo "- \"all\" - updates all plugins"
  28. tmux_echo "- ENTER - cancels"
  29. }
  30. update_plugin_prompt() {
  31. tmux command-prompt -p 'plugin update:' " \
  32. send-keys C-c; \
  33. run-shell '$SCRIPTS_DIR/update_plugin_prompt_handler.sh %1'"
  34. }
  35. main() {
  36. reload_tmux_environment
  37. display_plugin_update_list
  38. update_plugin_prompt
  39. }
  40. main