Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgv/clipboard
clipboard for zig
https://github.com/dgv/clipboard
clipboard linux macos multiplatform windows zig ziglang
Last synced: about 3 hours ago
JSON representation
clipboard for zig
- Host: GitHub
- URL: https://github.com/dgv/clipboard
- Owner: dgv
- License: mit
- Created: 2024-06-16T22:46:36.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-10T05:02:38.000Z (16 days ago)
- Last Synced: 2024-09-21T03:32:36.788Z (5 days ago)
- Topics: clipboard, linux, macos, multiplatform, windows, zig, ziglang
- Language: Zig
- Homepage:
- Size: 2.25 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clipboard
[![reference Zig](https://img.shields.io/badge/zig%20-0.13.0-orange)](https://github.com/dgv/clipboard/blob/main/build.zig.zon)
[![reference Zig](https://img.shields.io/badge/zigdoc%20-pages-orange)](https://dgv.dev.br/clipboard/)
[![reference Zig](https://img.shields.io/badge/deps%20-0-green)](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 ""});
}
```