I am no longer using any of the solutions from my first Emacs as an X Clipboard Manager post. I am now using an automatic, event-driven solution that is just a simple shell script. This makes the Emacs kill-ring an X clipboard manager without requiring the user to run some yank operation to pull content from the X clipboard. The shell script depends on clipnotify.
#!/bin/sh id=$(id -u) while clipnotify; do if pgrep -q -u "$id" -f 'emacs --daemon'; then emacsclient -n -e "(current-kill 0)" fi done
If you want to save the kill ring between Emacs sessions, add kill-ring to savehist-additional-variables.
Here is some configuration for ~/.tmux.conf, so tmux can exchange text with the X clipboard. It depends on xclip.
bind < run "xclip -sel clip -o|tmux load-buffer -;tmux paste-buffer" # ## Copy mode keybindings bind -Tcopy-mode M-w send -X copy-pipe-and-cancel 'xclip -sel clip -i' # bind -Tcopy-mode M-W send -X copy-pipe 'xclip -sel clip -i' # #  Copy the X clipboard contents into the tmux paste buffer and insert them # into the current pane. #  Copy the selection into the tmux paste buffer and the X clipboard.