From debdb5a4925429a1597d0bf2b3d2e61204a7e667 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:54:03 +0100 Subject: [PATCH] Shortcuts: Add an interactive screenshot shortcut (#2125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stanisław <6031763+stsdc@users.noreply.github.com> Co-authored-by: Leo --- data/gala.gschema.xml | 9 +++++++++ src/WindowManager.vala | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/data/gala.gschema.xml b/data/gala.gschema.xml index d37e8d96..e6bff01b 100644 --- a/data/gala.gschema.xml +++ b/data/gala.gschema.xml @@ -76,6 +76,11 @@ + + 'flatpak run io.elementary.screenshot' + Interactive screenshot action + Sets the command to run when the interactive-screenshot keybinding is pressed. + false Automatically move maximized windows to a new workspace @@ -144,6 +149,10 @@ Take a screenshot + + Print']]]> + Launch the interactive screenshot tool + Print']]]> Take a screenshot of a window diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 855c09c9..a51739ce 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -255,6 +255,7 @@ namespace Gala { display.add_keybinding ("switch-input-source-backward", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_switch_input_source); display.add_keybinding ("screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot); + display.add_keybinding ("interactive-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot); display.add_keybinding ("window-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot); display.add_keybinding ("area-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot); display.add_keybinding ("screenshot-clip", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot); @@ -518,6 +519,9 @@ namespace Gala { case "screenshot": screenshot_screen.begin (); break; + case "interactive-screenshot": + launch_action ("interactive-screenshot-action"); + break; case "area-screenshot": screenshot_area.begin (); break;