From 4c31b332a66864db3a4adc5ea3a0b0a43d50be02 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 17 Feb 2026 18:08:04 +0800 Subject: heeh --- setup/core/tmux.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 setup/core/tmux.sh (limited to 'setup/core/tmux.sh') 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 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" || exit + +TMUX_CONF="/etc/tmux.conf" +CLIP_HOST="p.noml.ch" +CLIP_PORT="5023" +CLIP_CMD="openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 ${CLIP_HOST} ${CLIP_PORT} >/dev/null 2>&1" + +cat << EOF > "$TMUX_CONF" +# Vi mode for copy +setw -g mode-keys vi + +# Mouse selection +set -g mouse on + +# v to start selection, y to yank (like vim) +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "${CLIP_CMD}" +EOF + +echo "tmux config written to $TMUX_CONF" -- cgit