diff options
Diffstat (limited to 'setup/core/tmux.sh')
| -rwxr-xr-x | setup/core/tmux.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/setup/core/tmux.sh b/setup/core/tmux.sh new file mode 100755 index 0000000..1d3a9bd --- /dev/null +++ b/setup/core/tmux.sh | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit | ||
| 4 | |||
| 5 | TMUX_CONF="/etc/tmux.conf" | ||
| 6 | CLIP_HOST="p.noml.ch" | ||
| 7 | CLIP_PORT="5023" | ||
| 8 | CLIP_CMD="openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 ${CLIP_HOST} ${CLIP_PORT} >/dev/null 2>&1" | ||
| 9 | |||
| 10 | cat << EOF > "$TMUX_CONF" | ||
| 11 | # Vi mode for copy | ||
| 12 | setw -g mode-keys vi | ||
| 13 | |||
| 14 | # Mouse selection | ||
| 15 | set -g mouse on | ||
| 16 | |||
| 17 | # v to start selection, y to yank (like vim) | ||
| 18 | bind-key -T copy-mode-vi v send-keys -X begin-selection | ||
| 19 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" | ||
| 20 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" | ||
| 21 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" | ||
| 22 | EOF | ||
| 23 | |||
| 24 | echo "tmux config written to $TMUX_CONF" | ||
