Skip to content

Commit debdb5a

Browse files
leolost2605stsdclenemter
authored
Shortcuts: Add an interactive screenshot shortcut (#2125)
Co-authored-by: Stanisław <[email protected]> Co-authored-by: Leo <[email protected]>
1 parent 37e8c4d commit debdb5a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

data/gala.gschema.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
<summary></summary>
7777
<description></description>
7878
</key>
79+
<key type="s" name="interactive-screenshot-action">
80+
<default>'flatpak run io.elementary.screenshot'</default>
81+
<summary>Interactive screenshot action</summary>
82+
<description>Sets the command to run when the interactive-screenshot keybinding is pressed.</description>
83+
</key>
7984
<key type="b" name="move-maximized-workspace">
8085
<default>false</default>
8186
<summary>Automatically move maximized windows to a new workspace</summary>
@@ -144,6 +149,10 @@
144149
<default><![CDATA[['Print']]]></default>
145150
<summary>Take a screenshot</summary>
146151
</key>
152+
<key name="interactive-screenshot" type="as">
153+
<default><![CDATA[['<Super>Print']]]></default>
154+
<summary>Launch the interactive screenshot tool</summary>
155+
</key>
147156
<key name="window-screenshot" type="as">
148157
<default><![CDATA[['<Alt>Print']]]></default>
149158
<summary>Take a screenshot of a window</summary>

src/WindowManager.vala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ namespace Gala {
255255
display.add_keybinding ("switch-input-source-backward", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_switch_input_source);
256256

257257
display.add_keybinding ("screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
258+
display.add_keybinding ("interactive-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
258259
display.add_keybinding ("window-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
259260
display.add_keybinding ("area-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
260261
display.add_keybinding ("screenshot-clip", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
@@ -518,6 +519,9 @@ namespace Gala {
518519
case "screenshot":
519520
screenshot_screen.begin ();
520521
break;
522+
case "interactive-screenshot":
523+
launch_action ("interactive-screenshot-action");
524+
break;
521525
case "area-screenshot":
522526
screenshot_area.begin ();
523527
break;

0 commit comments

Comments
 (0)