Skip to content

Commit

Permalink
docs: add ya.clipboard to utils (#101)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲雅 · Misaki Masa <[email protected]>
  • Loading branch information
AnirudhG07 and sxyazi authored Jul 18, 2024
1 parent 2e09d9d commit 4b8b62d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/plugins/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,22 @@ This function is only available on Unix-like systems.

Only available on Unix-like systems. Returns the hostname of the current machine, which is a string if successful; otherwise, `nil`.

### `clipboard(text)` {#ya.clipboard}

Get or set the content of the system clipboard.

- `text` - Optional, value to be set, which is a string. If not provided, the content of the clipboard will be returned.

```lua
-- Get contents from the clipboard
local content = ya.clipboard()

-- Set contents to the clipboard
ya.clipboard("new content")
```

This function is only available in the async context.

## ps {#ps}

Yazi's DDS (Data Distribution Service) uses a Lua-based publish-subscribe model as its carrier. That is, you can achieve cross-instance communication and state persistence through the `ps` API. See [DDS](/docs/dds) for details.
Expand Down

0 comments on commit 4b8b62d

Please sign in to comment.