Skip to content

Commit

Permalink
[Update] add Linux Wayland clipboard chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mistricky authored Dec 23, 2024
1 parent ab7b5fe commit 5fe4d4d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,33 @@ Or if you are using CLI tool, CodeSnap will generate a default config file for y
All configuration items can be found in [config.rs](https://github.com/mistricky/CodeSnap/blob/main/core/src/config.rs)


## Linux Wayland
Copy screenshots directly into the clipboard is cool, however, it doesn't work well on wl-clipboard, because the wl-clipboard can't paste the content which come from exited processes. As Hyprland document say:


> When we copy something on Wayland (using wl-clipboard) and close the application we copied from, the copied data disappears from the clipboard and we cannot paste it anymore. So to fix this problem we can use a program called as wl-clip-persist which will preserve the data in the clipboard after the application is closed.

If you are using CodeSnap on wl-clipboard, you can refer [wl-clip-persist](https://github.com/Linus789/wl-clip-persist), it reads all the clipboard data into memory and then overwrites the clipboard with the data from our memory to persist copied data.

### Save the snapshot

Of course, you can use `CodeSnapSave` command to save the snapshot to path where you defined it in `config.save_path`
```lua
require("codesnap").setup({
-- The save_path must be ends with .png, unless when you specified a directory path,
-- CodeSnap will append an auto-generated filename to the specified directory path
-- For example:
-- save_path = "~/Pictures"
-- parsed: "~/Pictures/CodeSnap_y-m-d_at_h:m:s.png"
-- save_path = "~/Pictures/foo.png"
-- parsed: "~/Pictures/foo.png"
save_path = ...
})
```

https://github.com/mistricky/codesnap.nvim/assets/22574136/69b27e77-3dce-4bc3-8516-89ce636fe02d



## ❤️ Related projects
Expand Down

0 comments on commit 5fe4d4d

Please sign in to comment.