In order to minimize mouse usage (accessibility and health reasons), how can I pipe the standard out to the OS clip board?
That is, I'd like to do something like:
$ drush uli | copy-this-to-clipbaord
$ drush uli > copy-this-to-clipbaord
Possible?
In order to minimize mouse usage (accessibility and health reasons), how can I pipe the standard out to the OS clip board?
That is, I'd like to do something like:
$ drush uli | copy-this-to-clipbaord
$ drush uli > copy-this-to-clipbaord
Possible?
Install xsel either through the above link or through the terminal:
To copy the output of a command use:
An example:
You can make it simpler by editing (create it if you don't already have it with
touch ~/.bash_aliases
) your~/.bash_aliases
file.Add this line to it:
alias clipboard = 'xsel -ib'
(you can use any name, not justclipboard
).Once you've done so you can use:
*command* | clipboard
I use xclip.
Example:
You can use
xsel
in just that way:-i
(--input
) makes it read input from standard input-b
(--clipboard
) makes it use the clipboard buffer instead the selection or one of the less commonly further buffers.>/dev/null
is hiding some annoying error message - not shure that can occur with these options set.So, why not try
and tell whether paste from clipboard pastes the right text!
I left out the part hiding errors for testing.