From 255fcb09b77c43d99007454af735fd0e919def54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=BC=80=E7=AE=B1?= Date: Sun, 29 Jan 2023 00:02:21 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=89=8B=E5=8A=A8=E9=80=89=E9=A2=98][tech]:?= =?UTF-8?q?=2020230119.1=20=E2=AD=90=EF=B8=8F=20GNOME=20Screenshot=20Tool?= =?UTF-8?q?=20Old=20and=20New=20Methods.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... GNOME Screenshot Tool Old and New Methods.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md diff --git a/sources/tech/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md b/sources/tech/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md new file mode 100644 index 0000000000..3e0c0aa77b --- /dev/null +++ b/sources/tech/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md @@ -0,0 +1,144 @@ +[#]: subject: "GNOME Screenshot Tool: Old and New Methods" +[#]: via: "https://www.debugpoint.com/gnome-screenshot-tool-usage/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GNOME Screenshot Tool: Old and New Methods +====== + +**Here are the details about the GNOME Screenshot tool, its usage and how to install and launch them in older and modern methods.** + +![][1] + +In 2022, GNOME changed its default screenshot tool and built the screenshot function as part of the GNOME Shell. It’s not a separate application anymore. + +Earlier, GNOME featured a native GTK app gnome-screenshot via all the major Linux distributions such as Ubuntu and Fedora. However, from [GNOME 42][2] onwards, this has been removed. Hence [Ubuntu 22.04][3] and Fedora 36 onwards, you only get the following new screenshot UI as a default screenshot utility. + +This change fundamentally broke many workflows. Since it is not an executable you can launch separately, you only depend on the keyboard’s print-screen key. And only a shortcut is available via application search. + +Hence, capturing screenshots with a delay in the new GNOME screenshot UI becomes much more challenging. + +Here are some of the ways you can still use the older GNOME Screenshot tool and how to trigger the new screenshot UI manually. + +### GNOME Screenshot Tool: How to install the old GUI + +If you are using Ubuntu 22.04 and above, or any Ubuntu-based distribution with a GNOME desktop, run the following command to install it. + +``` +sudo apt install gnome-screenshot +``` + +And for Fedora users, use the following command. + +``` +sudo dnf install gnome-screenshot +``` + +If you are using a **GNOME desktop in Arch Linux** or Manjaro Linux GNOME, then use the below command to install it. + +``` +pacman -S gnome-desktop +``` + +After installation, launch it via the application menu. + +![GNOME Screenshot (old)][4] + +![GNOME Screenshot main window (old)][5] + +For further customization, you can open Settings and remove the keybinding of Print-Screen from the Shell’s new UI and create a custom keyboard shortcut with the following commands. + +``` +gnome-screenshot --window +gnome-screenshot --area +gnome-screenshot +``` + +### GNOME Screenshot UI: How to manually trigger it via the command line + +The function which executes when you press the Print-Screen key from the keyboard is part of the [GNOME Shell code][6]. Unfortunately, it is protected inside dbus API, and you can not invoke it directly. + +It has been done to make you safe under Wayland so that no arbitrary code gets access to dbus call functions via any script. + +However, this broke many use cases and scripts which people wrote over the years. For example, many users reported [Zoom][7] videoconferencing calls [broke][8] under GNOME-Wayland due to this, which was eventually solved via the below method of turning off the safe mode. + +Let’s see how you can turn it off and trigger the gnome-shell screenshot + +Use caution before using the following steps. Since it may open up your GNOME Shell for arbitrary script access. Make sure you know what you are doing. + +First, you need to open [GNOME looking glass][9] to turn off the safe mode. + +Press `ALT+F`2 and type below: + +``` +lg +``` + +![Launch looking glass][10] + +Select Evaluator at the top, and in the command window, type the following. And hit enter. + +``` +global.context.unsafe_mode = true +``` + +![Turn off safe mode][11] + +You should see a response that it is turned off. + +![Verification][12] + +Now press escape to close the looking glass. And open a terminal prompt. + +And type the following to launch the screenshot tool. + +``` +gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.screenshotUI.open();' +``` + +You should see the new GNOME Shell screenshot triggered. + +![Launch new GNOME Shell Screenshot UI from CLI][13] + +If you want to turn it off, open `lg` again and set it to false. + +``` +global.context.unsafe_mode = true +``` + +### Closing Notes + +Usage-wise, you can still use the new screenshot feature via any shell script by turning off the safe mode. But it is not recommended. It’s always better to use the old GNOME Screenshot tool to avoid all the hassles. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-screenshot-tool-usage/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/gnome-sc1-1.jpg +[2]: https://www.debugpoint.com/gnome-42/ +[3]: https://www.debugpoint.com/ubuntu-22-04-review/ +[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/GNOME-Screenshot-old.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/GNOME-Screenshot-main-window-old.jpg +[6]: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/screenshot.js#L2210 +[7]: https://www.debugpoint.com/zoom-install-linux-ubuntu-download/ +[8]: https://community.zoom.com/t5/Meetings/Wayland-screen-sharing-broken-with-GNOME-41-on-Fedora-35/m-p/22539 +[9]: https://wiki.gnome.org/Projects/GnomeShell/LookingGlass +[10]: https://www.debugpoint.com/wp-content/uploads/2023/01/Launch-looking-glass.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Turn-off-safe-mode.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2023/01/Verification.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2023/01/Launch-new-GNOME-Shell-Screenshot-UI-from-CLI.jpg