Copying & Pasting with URxvt
For pasting text, in urxvt/rxvt-unicode you can use middle button to paste PRIMARY selection and Alt/Meta+middle button to paste CLIPBOARD.
For copying, just marking the text in the terminal copies it to the PRIMARY selection. Some work is needed for copying to the CLIPBOARD selection though. I combined the information from the Archlinux page you linked with scripts included in rxvt-unicode-9.19 and ended up with a script like this: https://gist.github.com/xkr47/98224ed6b0860cb55ec0. It allows one to use Ctrl+Insert or Ctrl+Shift+c` to copy the currently selected text to CLIPBOARD.
Hope this helps.
For the record, I also don't run a desktop environment; using Sawfish as window manager.
Tip: You can monitor the clipboard in a terminal using either the "xclip" program:
while :; do echo -ne '\033[31;1mCLIPBOARD: ' ; xclip -o -sel c ; echo ; echo -ne '\033[32;1mPRIMARY: ' ; xclip -o -sel p ; echo ; echo -e '\033[m--------' ; sleep 1 ; done
or using the "xsel" program:
while :; do echo -ne '\033[31;1mCLIPBOARD: ' ; xsel -b -o ; echo ; echo -ne '\033[32;1mPRIMARY: ' ; xclip -p -o ; echo ; echo -e '\033[m--------' ; sleep 1 ; done
There are built-in mechanisms for copying/pasting to/from PRIMARY
(is used when the user selects some data) and CLIPBOARD
(is used when the user selects some data and explicitly requests it to be "copied" to the clipboard, such as by invoking "Copy" under the "Edit" menu of an application). More about different clipboards in X.
For CLIPBOARD
buffer it is CTRL+META+C
(which is CTRL+ALT+C
for standard PC keyboard) for copying and CTRL+META+V
(CTRL+ALT+V
) for pasting.
Quotation from urxvt man:
THE SELECTION: SELECTING AND PASTING TEXT
The behaviour of text selection and insertion/pasting mechanism is similar to xterm(1).
Selecting:
Left click at the beginning of the region, drag to the end of the region and release; Right click to extend the marked region; Left double-click to select a word; Left triple-click to select the entire logical line (which can span multiple screen lines), unless modified by resource tripleclickwords.
Starting a selection while pressing the Meta key (or Meta+Ctrl keys) (Compile: frills) will create a rectangular selection instead of a normal one. In this mode, every selected row becomes its own line in the selection, and trailing whitespace is visually underlined and removed from the selection.
Pasting:
Pressing and releasing the Middle mouse button in an urxvt window causes the value of the PRIMARY selection (or CLIPBOARD with the Meta modifier) to be inserted as if it had been typed on the keyboard.
Pressing Shift-Insert causes the value of the PRIMARY selection to be inserted too.
rxvt-unicode also provides the bindings Ctrl-Meta-c and to interact with the CLIPBOARD selection. The first binding causes the value of the internal selection to be copied to the CLIPBOARD selection, while the second binding causes the value of the CLIPBOARD selection to be inserted.
Unfortunately, the X window system has several different copy-paste mechanisms.
Rxvt, like most old-school X applications, uses the primary selection. Generally, when you select something with the mouse, it's automatically copied to the primary selection, and when you middle-click to paste, that pastes the primary selection.
Ctrl+C and Ctrl+V (or other key bindings) in applications using modern GUI toolkits, such as Gnome-terminal and Firefox, copy/paste from the clipboard.
There are tools to facilitate working with the selections. In particular, if you just want to have a single selection that's copied to whether you select with the mouse or press Ctrl+C, you can run autocutsel (start it from your .xinitrc
or from your desktop environment's startup programs), which detects when something is copied to one of the selections and automatically copies it to the other.