Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/asvvvad1/vlipboard

An extension to the V clipboard library with additional support
https://github.com/asvvvad1/vlipboard

clipboard clipboard-library clipborad plan9 termux v wayland wl-clipboard

Last synced: 2 months ago
JSON representation

An extension to the V clipboard library with additional support

Awesome Lists containing this project

README

        

# vlipboard
An extended clipboard library for V with Wayland, Termux, Plan 9 and xclip & xclip fallback support.
It's meant to be easier to use and simple. Contributions welcome!

## Requirements:
- Wayland support needs [wl-clipboard](https://github.com/bugaevc/wl-clipboard) to be in $PATH
- Termux support only needs the Addons:API package to be installed
- There is no direct way to build V programs for Plan 9 but you can compile to C code then build it on your Plan 9 machine. see https://github.com/vlang/v/issues/4979

>Written a V port of wl-clipboard or want to do so? have an idea on other platforms support? You're welcome to open an issue or a pull request! This is my first V module and I just started out learning so any help is welcome ^^

# Usage:
```v
import asvvvad.vlipboard

fn main() {
mut clip := vlipboard.new() or {
panic(err)
}

text := 'Hello, world!'
clip.copy(text) // copy() returns true on success
println(clip.paste()) // 'Hello, world!'
clip.clear() // clear() returns true on success
println(clip.paste().len <= 0) // true
}
```
That's it! :3