From 17fe830d38ea039209712504e95a6826b73940f8 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sat, 6 May 2023 14:27:59 -0500 Subject: fix(tmux,zsh): fix load order for clipboard hooks --- tmux/.config/tmux/tmux.conf | 1 - tmux/.local/bin/tmux-clipboard.sh | 57 --------------------------------------- 2 files changed, 58 deletions(-) delete mode 100755 tmux/.local/bin/tmux-clipboard.sh (limited to 'tmux') diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index b8c04ab..d35748c 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -44,7 +44,6 @@ if "test ! -d $XDG_CONFIG_HOME/tmux/plugins/tpm" \ && $XDG_CONFIG_HOME/tmux/plugins/tpm/bin/install_plugins'" run '$XDG_CONFIG_HOME/tmux/plugins/tpm/tpm' -run '~/.local/bin/tmux-clipboard.sh' set-hook -g session-created 'if -F "#{m/r:^[0-9]+$,#{session_name}}" "rename-session \"#{b:session_path}\""' diff --git a/tmux/.local/bin/tmux-clipboard.sh b/tmux/.local/bin/tmux-clipboard.sh deleted file mode 100755 index 9d4d993..0000000 --- a/tmux/.local/bin/tmux-clipboard.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -paste_selection_default="clipboard" -paste_selection_option="@paste_selection" - -custom_paste_command_default="" -custom_paste_command_option="@custom_paste_command" - -get_tmux_option() { - option="$1" - default_value="$2" - option_value=$(tmux show-option -gqv "$option") - if [ -z "$option_value" ]; then - echo "$default_value" - else - echo "$option_value" - fi -} - -paste_selection() { - get_tmux_option "$paste_selection_option" "$paste_selection_default" -} - -custom_paste_cmd() { - get_tmux_option "$custom_paste_command_option" "$custom_paste_command_default" -} - -clipboard_paste_command() { - if [ -n "$(override_paste_cmd)" ]; then - override_paste_cmd - elif command -v pbpaste 1>/dev/null; then - if command -v reattach-to-user-namespace 1>/dev/null; then - echo "reattach-to-user-namespace pbpaste" - else - echo "pbpaste" - fi - elif command -v win32yank.exe 1>/dev/null; then - echo "win32yank.exe -o" - elif [ -n "$DISPLAY" ] && command -v xsel 1>/dev/null; then - echo "xsel -o --$(paste_selection)" - elif [ -n "$DISPLAY" ] && command -v xclip 1>/dev/null; then - echo "xclip -o -selection $(paste_selection)" - elif command -v getclip 1>/dev/null; then - echo "getclip" - elif [ -n "$(custom_paste_cmd)" ]; then - custom_paste_cmd - fi -} - -main() { - paste_command="$(clipboard_paste_command)" - if [ -n "$paste_command" ]; then - tmux set-hook -g client-focus-in "run '$paste_command | tmux load-buffer -b clipboard -'" - fi -} - -main -- cgit v1.2.3-70-g09d2