2016-06-21 01:36:03 +03:00
|
|
|
# xsel
|
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
> X11 selection and clipboard manipulation tool.
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2017-04-29 01:34:51 +03:00
|
|
|
- Use a command's output as input of the clip[b]oard (equivalent to `Ctrl + C`):
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
`echo 123 | xsel -ib`
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
- Use the contents of a file as input of the clipboard:
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
`cat {{file}} | xsel -ib`
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2017-04-29 01:34:51 +03:00
|
|
|
- Output the clipboard's contents into the terminal (equivalent to `Ctrl + V`):
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
`xsel -ob`
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
- Output the clipboard's contents into a file:
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
`xsel -ob > {{file}}`
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
- Clear the clipboard:
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
`xsel -cb`
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 11:43:21 +03:00
|
|
|
- Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click):
|
2016-06-21 01:36:03 +03:00
|
|
|
|
2016-06-25 04:07:46 +03:00
|
|
|
`xsel -op`
|