From 26299ab999009f5316c60a72e30234e557304b17 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 11 Oct 2022 21:17:18 -0400 Subject: [PATCH] Pass db location when launching hydrus, force XCB backend --- src/main.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 394a520..d3ab868 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,9 +30,19 @@ fn make_temp_location(path: &str) -> String { fn launch_hydrus(config: &Config) { println!("Launching hydrus..."); - let hydrus = Command::new(&config.hydrus_exec_location) - .status() - .expect("Failed to run hydrus"); + let mut hydrus = Command::new(&config.hydrus_exec_location); + let hydrus = hydrus.args(["-d", &config.hydrus_db_location]); + + if cfg!(unix) { + hydrus + .env("QT_QPA_PLATFORM", "xcb") + .status() + .expect("Failed to run hydrus"); + } else { + hydrus + .status() + .expect("Failed to run hydrus"); + } } fn is_locked(config: &Config) -> bool {