mirror of
https://github.com/Noratrieb/clippyboard.git
synced 2026-01-14 09:55:04 +01:00
split into crates
This commit is contained in:
parent
06b5244638
commit
14e5170f4f
13 changed files with 112 additions and 67 deletions
8
clippyboard-clear/Cargo.toml
Normal file
8
clippyboard-clear/Cargo.toml
Normal 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"
|
||||
19
clippyboard-clear/src/main.rs
Normal file
19
clippyboard-clear/src/main.rs
Normal 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(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue