max / alloy
| 1 | #!/bin/sh |
| 2 | # alloy-clipstore — store a clipboard selection, unless it is a secret. |
| 3 | # |
| 4 | # What the sway config's two `wl-paste --watch` lines call instead of |
| 5 | # `cliphist store` directly. The read half is still alloy-clipmenu and the |
| 6 | # store is still cliphist's; this only decides whether an item reaches it. |
| 7 | # |
| 8 | # The rule is one line: if alloy-secret-copy left its sentinel, this selection |
| 9 | # is a password on its way to a paste and is not history. See that script for |
| 10 | # why a sentinel rather than the `x-kde-passwordManagerHint` MIME convention, |
| 11 | # and for the failure direction it is built around. GO alloy problem e7a9e38c. |
| 12 | # |
| 13 | # Consuming stdin on the skip path is deliberate. `wl-paste --watch` writes the |
| 14 | # selection to this process; exiting without reading it leaves the writer with |
| 15 | # a closed pipe and a SIGPIPE on the next selection, which is a broken watcher |
| 16 | # rather than a skipped item. |
| 17 | |
| 18 | |
| 19 | |
| 20 | sentinel="/alloy-secret-clipboard" |
| 21 | |
| 22 | if [; then |
| 23 | |
| 24 | |
| 25 | fi |
| 26 | |
| 27 | |
| 28 |