blob: 45023492cd90a51e091a1eed703718b0a12c458f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# clipboard
The clipboard history as a drawer page, replacing the rofi list. The history
itself is cliphist's, fed by `wl-paste --watch cliphist store` from autostart;
this module only reads and edits it. CTRL+SHIFT+L opens the drawer straight on
this page (`ipc call drawer open clipboard`).
- The search field has focus on open and filters as you type, ignoring case.
- Up and Down move the highlight; Enter or a click copies the entry and closes
the drawer.
- `×` on a row deletes that entry; "Clear all" asks once more ("Confirm?",
3 seconds) and then runs `cliphist wipe`.
Nothing runs while the drawer is closed: the page runs `cliphist list` when
it opens. 750 entries measured, 42 of them images.
**Entries are untrusted text.** Copy and delete pass the cliphist line to
`sh -c` as `$1` and print it into `cliphist decode` or `cliphist delete`; it
never becomes part of a command string.
**Images show as thumbnails.** A row whose preview is cliphist's
`[[ binary data <size> <type> <WxH> ]]` decodes the entry once into
`$XDG_RUNTIME_DIR/qs-clip/<id>.png` and reuses the file after. That directory
is tmpfs, so a reboot clears it. The list is a `ListView`, so only rows that
are created decode.
`Clip.js` holds the parsing and the filter, tested with:
node desktop/modules/clipboard/test_clip.js
|