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.
This commit is contained in:
Lily Ballard 2019-03-18 21:23:42 -07:00
parent f9dcdb0531
commit 8bcf0e4a0e

View file

@ -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())