2025-03-14 21:59:59 -06:00
|
|
|
# xsel
|
|
|
|
|
|
|
|
|
|
> X11 selection and clipboard manipulation tool.
|
|
|
|
|
> More information: <https://manned.org/xsel>.
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Use a command's output as input of the clipboard (equivalent to `<Ctrl c>`):
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`echo 123 | xsel {{[-ib|--input --clipboard]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Use the contents of a file as input of the clipboard:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`cat {{path/to/file}} | xsel {{[-ib|--input --clipboard]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
- Output the clipboard's contents into the terminal (equivalent to `<Ctrl v>`):
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`xsel {{[-ob|--output --clipboard]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Output the clipboard's contents into a file:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`xsel {{[-ob|--output --clipboard]}} > {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Clear the clipboard:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`xsel {{[-cb|--clear --clipboard]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
- Output the X11 primary selection's contents into the terminal (equivalent to a mouse `<MiddleClick>`):
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`xsel {{[-op|--output --primary]}}`
|