diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-31 14:23:54 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-31 14:23:54 +0400 |
| commit | b0af1129c91a21e29da15f9c5ea6a6dd32c1d85d (patch) | |
| tree | 75f1401c1bb62ac7eec446cc4ce6797d5286b149 /src/niri.rs | |
| parent | 02f6b418fef92d076134acbb31e72f38c73dc5ba (diff) | |
| download | niri-b0af1129c91a21e29da15f9c5ea6a6dd32c1d85d.tar.gz niri-b0af1129c91a21e29da15f9c5ea6a6dd32c1d85d.tar.bz2 niri-b0af1129c91a21e29da15f9c5ea6a6dd32c1d85d.zip | |
Include filename in screenshot-path
Diffstat (limited to 'src/niri.rs')
| -rw-r--r-- | src/niri.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/niri.rs b/src/niri.rs index 559411d7..5f5a02e4 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -2077,8 +2077,6 @@ impl Niri { use smithay::backend::renderer::element::utils::{Relocate, RelocateRenderElement}; - use crate::utils::add_screenshot_filename; - let _span = tracy_client::span!("Niri::screenshot_all_outputs"); let mut elements = vec![]; @@ -2103,15 +2101,13 @@ impl Niri { let pixels = render_to_vec(renderer, size, Scale::from(1.), Fourcc::Abgr8888, &elements)?; let path = make_screenshot_path(&self.config.borrow()) - .and_then(|path| match path { - Some(path) => Ok(path), - None => { - let mut path = env::temp_dir(); - add_screenshot_filename(&mut path)?; - Ok(path) - } - }) - .context("error making screenshot path")?; + .ok() + .flatten() + .unwrap_or_else(|| { + let mut path = env::temp_dir(); + path.push("screenshot.png"); + path + }); debug!("saving screenshot to {path:?}"); thread::spawn(move || { |
