Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgv/clipboard
multiplatform clipboard for zig
https://github.com/dgv/clipboard
clipboard linux macos multiplatform windows zig zig-package ziglang
Last synced: 26 days ago
JSON representation
multiplatform clipboard for zig
- Host: GitHub
- URL: https://github.com/dgv/clipboard
- Owner: dgv
- License: mit
- Created: 2024-06-16T22:46:36.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T02:58:21.000Z (about 2 months ago)
- Last Synced: 2024-12-01T10:57:56.462Z (about 1 month ago)
- Topics: clipboard, linux, macos, multiplatform, windows, zig, zig-package, ziglang
- Language: Zig
- Homepage:
- Size: 2.26 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clipboard
[![zig version](https://img.shields.io/badge/0.13.0-orange?style=flat&logo=zig&label=Zig&color=%23eba742)](https://ziglang.org/download/)
[![reference Zig](https://img.shields.io/badge/zigdoc%20-pages-orange?color=%23eba742)](https://dgv.dev.br/clipboard/)
[![reference Zig](https://img.shields.io/badge/deps%20-0-orange?color=%23eba742)](https://github.com/dgv/clipboard/blob/main/build.zig.zon)
[![0 dependencies!](https://0dependencies.dev/0dependencies.svg)](https://0dependencies.dev)
[![build](https://github.com/dgv/clipboard/actions/workflows/build.yml/badge.svg)](https://github.com/dgv/clipboard/actions/workflows/build.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)Provide copying and pasting text (UTF-8) to the clipboard for Zig.
### platform support
- MacOS
- Linux, Unix (requires 'xclip' or 'xsel' command to be installed)
- Windows### usage
#### install
```
zig fetch --save https://github.com/dgv/clipboard/archive/refs/heads/main.zip
```
#### import (build.zig)
```zig
...
exe.root_module.addImport("clipboard", b.dependency("clipboard", .{}).module("clipboard"));
b.installArtifact(exe);
```#### sample
```zig
const clipboard = @import("clipboard");
const std = @import("std");pub fn main() !void {
try clipboard.write("Zig ⚡");
std.debug.print("{s}\n", .{clipboard.read() catch ""});
}
```