From 8bcf0e4a0e5d8b0d2f39dba045cf524ff72e462c Mon Sep 17 00:00:00 2001 From: Lily Ballard Date: Mon, 18 Mar 2019 21:23:42 -0700 Subject: [PATCH] Support XCLIP_PATH at compilation to control the path to xclip If the `XCLIP_PATH` env var is set during compilation, it will be used to determine what binary to invoke for copying to the clipboard on Linux. Otherwise `xclip` will be looked up in the `PATH`. Fixes #71. --- src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.rs b/src/util.rs index 471d8f9..c0663da 100644 --- a/src/util.rs +++ b/src/util.rs @@ -297,7 +297,7 @@ pub fn set_clipboard(content: String) -> Result<(), ClipboardError> { #[cfg(target_os = "linux")] { // Open an xclip process - let mut process = match Command::new("xclip") + let mut process = match Command::new(option_env!("XCLIP_PATH").unwrap_or("xclip")) .arg("-sel") .arg("clip") .stdin(Stdio::piped())