3 Commits

Author SHA1 Message Date
f8ecf2ab2f chore(release): v0.0.2 (#5)
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
chore(release): 0.0.2

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #5
2025-08-03 12:06:19 +02:00
0de96429b1 feat: voidpin now copies to linux as well
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-02 18:58:57 +02:00
b25acd3ecb fix(deps): update all dependencies (#16)
Reviewed-on: https://git.front.kjuulh.io/kjuulh/voidpin/pulls/16
2025-04-14 09:59:43 +02:00
6 changed files with 347 additions and 185 deletions

View File

@@ -6,6 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.0.2] - 2025-08-02
### Added
- voidpin now copies to linux as well
- add demo gif
- add basic remote copu
### Docs
- add more thorough example
- correct docs
### Fixed
- *(deps)* update all dependencies (#16)
- *(deps)* update rust crate bytes to v1.10.1
- *(deps)* update rust crate serde to v1.0.218
- *(deps)* update tokio-prost monorepo to v0.13.5
- *(deps)* update rust crate uuid to v1.13.1
- *(deps)* update all dependencies
- *(deps)* update rust crate uuid to v1.12.0
### Other
- *(deps)* update all dependencies
- *(deps)* update all dependencies
- *(deps)* update all dependencies
- *(deps)* update rust crate clap to v4.5.29
- fix demo
## [0.0.1] - 2025-01-10
### Added

457
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"
[workspace.package]
version = "0.0.1"
version = "0.0.2"
[workspace.dependencies]
voidpin = { path = "crates/voidpin" }

View File

@@ -1,6 +1,6 @@
[package]
name = "voidpin"
edition = "2021"
edition = "2024"
version.workspace = true

View File

@@ -15,9 +15,26 @@ impl LocalCopier {
pub async fn copy(&self, input: &[u8]) -> anyhow::Result<()> {
// FIXME: hardcode for macos
let mut copy_process = tokio::process::Command::new("pbcopy")
.stdin(Stdio::piped())
.spawn()?;
#[cfg(target_os = "macos")]
let mut copy_process = {
tokio::process::Command::new("pbcopy")
.stdin(Stdio::piped())
.spawn()?
};
#[cfg(target_os = "linux")]
let mut copy_process = {
tokio::process::Command::new("wl-copy")
.stdin(Stdio::piped())
.spawn()?
};
#[cfg(target_os = "windows")]
let mut copy_process = {
todo!("windows not supported yet");
tokio::process::Command::new("wl-copy")
.stdin(Stdio::piped())
.spawn()?
};
if let Some(mut stdin_handle) = copy_process.stdin.take() {
stdin_handle

View File

@@ -70,6 +70,26 @@ async fn main() -> anyhow::Result<()> {
.await?;
}
Commands::Copy {} => {
if let Ok(remote_host) = std::env::var("VOIDPIN_REMOTE") {
let mut input = String::new();
std::io::stdin()
.read_to_string(&mut input)
.context("failed to read from stdin")?;
if input.is_empty() {
tracing::info!("no content to put in clipboard");
return Ok(());
}
tracing::debug!(content = &input, "found content");
state
.remote_copier(&remote_host)
.copy(input.as_bytes())
.await?;
return Ok(());
}
let mut input = String::new();
std::io::stdin()
.read_to_string(&mut input)
@@ -102,7 +122,6 @@ async fn main() -> anyhow::Result<()> {
.await?;
}
},
_ => (),
}
Ok(())