From c8105ae1a67f78a7b31374eb390a89538064cc59 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 10 Oct 2023 12:42:24 +0400 Subject: Add screenshot-window action --- src/input.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index c1e335dd..9f59c06e 100644 --- a/src/input.rs +++ b/src/input.rs @@ -167,6 +167,18 @@ impl State { } } } + Action::ScreenshotWindow => { + let active = self.niri.layout.active_window(); + if let Some((window, output)) = active { + if let Some(renderer) = self.backend.renderer() { + if let Err(err) = + self.niri.screenshot_window(renderer, &output, &window) + { + warn!("error taking screenshot: {err:?}"); + } + } + } + } Action::CloseWindow => { if let Some(window) = self.niri.layout.focus() { window.toplevel().send_close(); -- cgit