fix(tmux): set up clipboard correctly in wayland
GitOrigin-RevId: 31c72542163e4bdc934793bdc647e7145a3d00f9
diff --git a/dot_tmux.conf.tmpl b/dot_tmux.conf.tmpl
index 329346b..72f4b3d 100644
--- a/dot_tmux.conf.tmpl
+++ b/dot_tmux.conf.tmpl
@@ -19,9 +19,14 @@
set -sg escape-time 10
-{{if and .chezmoi.osRelease .chezmoi.osRelease.id (eq .chezmoi.osRelease.id "ubuntu") -}}
-set-option -s set-clipboard off
-bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
+{{if and .chezmoi.os (eq .chezmoi.os "linux") -}}
+if-shell 'test "$XDG_SESSION_TYPE" = "wayland"' '
+ set-option -s copy-command 'wl-copy'
+' '
+ # Assume we're running X if we're not running Wayland.
+ set-option -s set-clipboard off
+ bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
+'
{{- end}}
set -g @plugin "tmux-plugins/tpm"