2016-06-21 10:36:03 +12:00
|
|
|
# xsel
|
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
> X11 selection and clipboard manipulation tool.
|
2022-03-22 03:07:48 +10:00
|
|
|
> More information: <https://manned.org/xsel>.
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2025-03-09 14:03:08 +02:00
|
|
|
- Use a command's output as input of the clip[b]oard (equivalent to `<Ctrl c>`):
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
`echo 123 | xsel -ib`
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
- Use the contents of a file as input of the clipboard:
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2022-12-04 10:12:49 +01:00
|
|
|
`cat {{path/to/file}} | xsel -ib`
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2025-03-09 14:03:08 +02:00
|
|
|
- Output the clipboard's contents into the terminal (equivalent to `<Ctrl v>`):
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
`xsel -ob`
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
- Output the clipboard's contents into a file:
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2022-12-04 10:12:49 +01:00
|
|
|
`xsel -ob > {{path/to/file}}`
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
- Clear the clipboard:
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
`xsel -cb`
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2025-03-09 14:03:08 +02:00
|
|
|
- Output the X11 primary selection's contents into the terminal (equivalent to a mouse `<MiddleClick>`):
|
2016-06-21 10:36:03 +12:00
|
|
|
|
2016-06-25 02:07:46 +01:00
|
|
|
`xsel -op`
|