diff --git a/data/50-gnome-shell-screenshots.xml b/data/50-gnome-shell-screenshots.xml
new file mode 100644
index 000000000..d99f60bd2
--- /dev/null
+++ b/data/50-gnome-shell-screenshots.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data/meson.build b/data/meson.build
index 311a2b8f9..30d4917d8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -79,6 +79,7 @@ configure_file(
keybinding_files = [
'50-gnome-shell-launchers.xml',
+ '50-gnome-shell-screenshots.xml',
'50-gnome-shell-system.xml',
]
diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index 1dadb13c2..e686d2203 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -232,7 +232,15 @@
["Print"]
- Show screenshot UI
+ Take a screenshot interactively
+
+
+ ["<Alt>Print"]
+ Take a screenshot of a window
+
+
+ ["<Shift>Print"]
+ Take a screenshot
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 2b70d1d0c..cc81490c9 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -1288,6 +1288,42 @@ var ScreenshotUI = GObject.registerClass({
uiModes,
showScreenshotUI
);
+
+ Main.wm.addKeybinding(
+ 'screenshot-window',
+ new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ Meta.KeyBindingFlags.IGNORE_AUTOREPEAT | Meta.KeyBindingFlags.PER_WINDOW,
+ uiModes,
+ async (_display, window, _binding) => {
+ try {
+ const actor = window.get_compositor_private();
+ const content = actor.paint_to_content(null);
+ const texture = content.get_texture();
+
+ await captureScreenshot(texture, null, 1, null);
+ } catch (e) {
+ logError(e, 'Error capturing screenshot');
+ }
+ }
+ );
+
+ Main.wm.addKeybinding(
+ 'screenshot',
+ new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+ Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
+ uiModes,
+ async () => {
+ try {
+ const shooter = new Shell.Screenshot();
+ const [content] = await shooter.to_content();
+ const texture = content.get_texture();
+
+ await captureScreenshot(texture, null, 1, null);
+ } catch (e) {
+ logError(e, 'Error capturing screenshot');
+ }
+ }
+ );
}
_refreshButtonLayout() {
diff --git a/po/POTFILES.in b/po/POTFILES.in
index aafc3e345..2f6bd0ae7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,7 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
data/50-gnome-shell-launchers.xml
+data/50-gnome-shell-screenshots.xml
data/50-gnome-shell-system.xml
data/org.gnome.Shell.desktop.in.in
data/org.gnome.shell.gschema.xml.in