tonhowtf/omniget · error
xclip not found
Error message
xclip not found
What it means
On Linux, copy_file_linux first tries xclip to place the file URI on the clipboard. If the xclip process cannot be spawned (binary absent or not executable), the spawn error is swallowed and replaced with this 'xclip not found' error.
Solutions
- Install xclip: sudo apt install xclip (Debian/Ubuntu) or sudo dnf install xclip (Fedora).
- On Wayland, note xclip needs XWayland; alternatively ensure xsel is installed so the fallback path works.
- Verify with 'which xclip' before retrying the copy.
Example fix
// before $ omniget copy-file report.pdf # xclip not found // after $ sudo apt install xclip $ omniget copy-file report.pdf
Defensive patterns
Strategy: validation
Validate before calling
const which = (bin) => { try { return require('child_process').execSync(`which ${bin}`).toString().trim(); } catch { return null; } };
if (!which('xclip') && !which('xsel')) throw new Error('Install xclip or xsel for clipboard support'); Prevention
- Provision xclip in installation scripts for Linux targets
- Detect the missing binary at startup and tell users which package to install
- On Wayland deployments, verify XWayland is enabled
When it happens
Trigger: copy_file_to_clipboard on a Linux/X11 system where the xclip binary is not installed in PATH.
Common situations: Minimal Linux installs or Wayland-only sessions without X clipboard tools; containers and servers without xclip; fresh distros missing xclip package.
Related errors
- xsel not found
- {}
- wl-copy not found
- No clipboard tool found (tried xclip, xsel, wl-copy)
- yt-dlp not found in PATH or app data dir
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/fd7ed1baaecd3409.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/clipboard.rs:68
}
tracing::info!("[clipboard] copied file to clipboard (macOS)");
Ok(())
}
#[cfg(target_os = "linux")]
async fn copy_file_linux(path: &str) -> anyhow::Result<()> {
let uri = format!("file://{}", path);
let uri_clone = uri.clone();
let xclip_result = tokio::task::spawn_blocking(move || {
let mut child = match crate::core::process::std_command("xclip")
.args(["-selection", "clipboard", "-target", "text/uri-list"])
.stdin(std::process::Stdio::piped())
.spawn()
{
Ok(c) => c,
Err(_) => return Err(anyhow::anyhow!("xclip not found")),
};
if let Some(ref mut stdin) = child.stdin {
use std::io::Write;
let _ = stdin.write_all(uri_clone.as_bytes());
}
let output = child.wait_with_output()?;
if output.status.success() {
Ok(true)
} else {
Ok(false)
}
})
.await
.map_err(|e| anyhow::anyhow!("{}", e))?;
if let Ok(true) = xclip_result {
tracing::info!("[clipboard] copied file to clipboard (xclip): {}", path);
return Ok(());View on GitHub (pinned to 8600b91f42)