split into crates

This commit is contained in:
nora 2025-09-19 21:51:48 +02:00
parent 06b5244638
commit 14e5170f4f
13 changed files with 112 additions and 67 deletions

View file

@ -0,0 +1,8 @@
[package]
name = "clippyboard-clear"
version = "0.1.0"
edition = "2024"
[dependencies]
clippyboard-shared = { path = "../clippyboard-shared" }
eyre = "0.6.12"

View file

@ -0,0 +1,19 @@
use std::{io::Write, os::unix::net::UnixStream};
use eyre::Context;
fn main() -> eyre::Result<()> {
let socket_path = clippyboard_shared::socket_path()?;
let mut socket = UnixStream::connect(&socket_path).wrap_err_with(|| {
format!(
"connecting to socket at {}. is the daemon running?",
socket_path.display()
)
})?;
socket
.write_all(&[clippyboard_shared::MESSAGE_CLEAR])
.wrap_err("writing clear message to socket")?;
Ok(())
}