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:
sudo apt-get install xsel
To copy the output of a command use:
*command* | xsel -ib
An example:
$ drush uli | xsel -ib
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 just clipboard).
Once you've done so you can use: *command* | clipboard
You can use xsel in just that way:
xsel -i -b >/dev/null
-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
drush uli | xsel -i -b
and tell whether paste from clipboard pastes the right text!
I left out the part hiding errors for testing.