When I create scripts, I use the xclip
command to copy a variable to the clipboard, so I can paste it using CTRL+V
or automate my script to paste it with xdotool
. The command that I use to copy a variable to the clipboard is this one:
echo -n "$clipboard" | xclip -selection clipboard
It works fine for pasting with CTRL+V
... However, many times I want to paste things on a terminal window and only Shift+Insert
works for that. For some reason xclip
doesn't copy variables to the clipboard that Shift+Insert
uses, it only happens when I copy some text manually with CTRL+C
. Does anyone know if there's a way of programmatically copying a variable to the same clipboard that Shift+Insert uses?
Shift+Insert
uses theXA_PRIMARY
selection. So:or just
(since
XA_PRIMARY
is the default).