How do I access the Shift-Insert (paste) clipboard from a script? You can see what I use here.
Edit: A demonstration how it works, with
echo hello | xclip -selection secondary xclip -o -selection secondary
Edit 2: Just implemented the solution below. This will make my life so much easier so I thought I'd share it.
First, the script
#!/bin/zsh echo -n `xclip -d ":0" -o -selection clipboard`
(defun pst () "Inserts the X clipboard (xclip -d :0 -o -selection clipboard) at point. `M-1' (the '(1)) to insert in the current buffer." (interactive) (shell-command "pst" '(1)) (end-of-line) )
Now, in any tty, paste with
pst, in Emacs (anywhere, but specifically in a tty, as in X, you already have Shift-Insert)