diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2023-07-08 16:32:58 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2023-07-08 16:32:58 -0400 |
commit | d9ba1ed7ae531910616ba10e06d89fa71760ea54 (patch) | |
tree | 2cab0962062abc50d2f678c3eb3c7e9f01d913fb | |
parent | 38a00ffd05e1106a5e8d7b6ac53b9c1519bc0296 (diff) |
propagate DISPLAY to subprocess
-rw-r--r-- | src/main.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index e0d42f9..9f20a01 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,11 +21,13 @@ struct Args { async fn main() -> Result<(), Box<dyn Error>> { pretty_env_logger::init(); let args = Args::parse(); + let display = env::var("DISPLAY")?; info!("Current directory: {}", env::current_dir()?.display()); fs::create_dir(PROFILE_ROOT).ok(); let mut geckodriver = Command::new("geckodriver") .env("MOZ_REMOTE_SETTINGS_DEVTOOLS", "1") + .env("DISPLAY", display) .arg("--profile-root").arg("/tmp/geckodriver-dashboard").spawn()?; let c = ClientBuilder::native().connect("http://localhost:4444").await.expect("failed to connect to WebDriver"); @@ -43,6 +45,7 @@ async fn main() -> Result<(), Box<dyn Error>> { fs::write(&tmp_path, img)?; fs::rename(&tmp_path, output_path)?; time::sleep(Duration::from_secs(15)).await; + info!("Wrote {}", output_path.display()); } // c.close().await?; |