From 62b69020fea445814d6f82506d1428a7ac3894c1 Mon Sep 17 00:00:00 2001 From: jgart Date: Wed, 29 Sep 2021 22:22:12 -0400 Subject: [PATCH] Adds xsel support --- CHANGELOG.md | 2 ++ README.md | 2 +- src/utils.rs | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47044e5..66f04cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * Prompt user to open snippet in editor when editing existing snippet. #104 +* Support xsel as an alternative to xclip. + ## [0.14.4] - 2021-09-05 ### Fixed * .deb package extended description diff --git a/README.md b/README.md index ebaa417..6ad2977 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Table of Contents # Install ## Requirements -`xclip` on Linux and `pbcopy` on OSX +`xclip` or `xsel` on Linux and `pbcopy` on OSX ## Binaries See the [releases](https://github.com/out-of-cheese-error/the-way/releases/latest) diff --git a/src/utils.rs b/src/utils.rs index 2f225b6..521d4fe 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -29,6 +29,12 @@ mod copy { pub const ARGS: [&str; 3] = ["-in", "-selection", "clipboard"]; } +#[cfg(target_os = "linux")] +mod copy { + pub const COMMAND: &str = "xsel"; + pub const ARGS: [&str; 3] = ["-ib"]; +} + #[cfg(target_os = "macos")] mod copy { pub const COMMAND: &str = "pbcopy";