Shortcuts: Add an interactive screenshot shortcut (#2125)

Co-authored-by: Stanisław <6031763+stsdc@users.noreply.github.com>
Co-authored-by: Leo <lenemter@gmail.com>
This commit is contained in:
Leonhard 2024-12-03 18:54:03 +01:00 committed by GitHub
parent 37e8c4d66b
commit debdb5a492
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -76,6 +76,11 @@
<summary></summary>
<description></description>
</key>
<key type="s" name="interactive-screenshot-action">
<default>'flatpak run io.elementary.screenshot'</default>
<summary>Interactive screenshot action</summary>
<description>Sets the command to run when the interactive-screenshot keybinding is pressed.</description>
</key>
<key type="b" name="move-maximized-workspace">
<default>false</default>
<summary>Automatically move maximized windows to a new workspace</summary>
@ -144,6 +149,10 @@
<default><![CDATA[['Print']]]></default>
<summary>Take a screenshot</summary>
</key>
<key name="interactive-screenshot" type="as">
<default><![CDATA[['<Super>Print']]]></default>
<summary>Launch the interactive screenshot tool</summary>
</key>
<key name="window-screenshot" type="as">
<default><![CDATA[['<Alt>Print']]]></default>
<summary>Take a screenshot of a window</summary>

View File

@ -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;