From d2c45c2c6345ac1777c7daf81f9108fa09632d7c Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 18 Sep 2018 10:38:28 +0800 Subject: [PATCH] translated --- ... Screenshot in Linux [GUI and Terminal].md | 224 ------------------ ... Screenshot in Linux [GUI and Terminal].md | 211 +++++++++++++++++ 2 files changed, 211 insertions(+), 224 deletions(-) delete mode 100644 sources/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md create mode 100644 translated/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md diff --git a/sources/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md b/sources/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md deleted file mode 100644 index 6f91b77563..0000000000 --- a/sources/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md +++ /dev/null @@ -1,224 +0,0 @@ -HankChow translating - -5 Ways to Take Screenshot in Linux [GUI and Terminal] -====== -Here are several ways you can take screenshots and edit the screenshots by adding text, arrows etc. Instructions and mentioned screenshot tools are valid for Ubuntu and other major Linux distributions. - -![How to take screenshots in Ubuntu Linux][1] - -When I switched from Windows to Ubuntu as my primary OS, the first thing I was worried about was the availability of screenshot tools. Well, it is easy to utilize the default keyboard shortcuts in order to take screenshots but with a standalone tool, I get to annotate/edit the image while taking the screenshot. - -In this article, we will introduce you to the default methods/tools (without a 3rd party screenshot tool) to take a screenshot while also covering the list of best screenshot tools available for Linux. - -### Method 1: The default way to take screenshot in Linux - -Do you want to capture the image of your entire screen? A specific region? A specific window? - -If you just want a simple screenshot without any annotations/fancy editing capabilities, the default keyboard shortcuts will do the trick. These are not specific to Ubuntu. Almost all Linux distributions and desktop environments support these keyboard shortcuts. - -Let’s take a look at the list of keyboard shortcuts you can utilize: - -**PrtSc** – Save a screenshot of the entire screen to the “Pictures” directory. -**Shift + PrtSc** – Save a screenshot of a specific region to Pictures. -**Alt + PrtSc** – Save a screenshot of the current window to Pictures. -**Ctrl + PrtSc** – Copy the screenshot of the entire screen to the clipboard. -**Shift + Ctrl + PrtSc** – Copy the screenshot of a specific region to the clipboard. -**Ctrl + Alt + PrtSc** – Copy the screenshot of the current window to the clipboard. - -As you can see, taking screenshots in Linux is absolutely simple with the default screenshot tool. However, if you want to immediately annotate (or other editing features) without importing the screenshot to another application, you can use a dedicated screenshot tool. - -#### **Method 2: Take and edit screenshots in Linux with Flameshot** - -![flameshot][2] - -Feature Overview - - * Annotate (highlight, point, add text, box in) - * Blur part of an image - * Crop part of an image - * Upload to Imgur - * Open screenshot with another app - - - -Flameshot is a quite impressive screenshot tool which arrived on [GitHub][3] last year. - -If you have been searching for a screenshot tool that helps you annotate, blur, mark, and upload to imgur while being actively maintained unlike some outdated screenshot tools, Flameshot should be the one to have installed. - -Fret not, we will guide you how to install it and configure it as per your preferences. - -To install it on Ubuntu, you just need to search for it on Ubuntu Software center and get it installed. In case you want to use the terminal, here’s the command for it: -``` -sudo apt install flameshot - -``` - -If you face any trouble installing, you can follow their [official installation instructions][4]. After installation, you need to configure it. Well, you can always search for it and launch it, but if you want to trigger the Flameshot screenshot tool by using **PrtSc** key, you need to assign a custom keyboard shortcut. - -Here’s how you can do that: - - * Head to the system settings and navigate your way to the Keyboard settings. - * You will find all the keyboard shortcuts listed there, ignore them and scroll down to the bottom. Now, you will find a **+** button. - * Click the “+” button to add a custom shortcut. You need to enter the following in the fields you get: -**Name:** Anything You Want -**Command:** /usr/bin/flameshot gui - * Finally, set the shortcut to **PrtSc** – which will warn you that the default screenshot functionality will be disabled – so proceed doing it. - - - -For reference, your custom keyboard shortcut field should look like this after configuration: - -![][5] -Map keyboard shortcut with Flameshot - -### **Method 3: Take and edit screenshots in Linux with Shutter** - -![][6] - -Feature Overview: - - * Annotate (highlight, point, add text, box in) - * Blur part of an image - * Crop part of an image - * Upload to image hosting sites - - - -[Shutter][7] is a popular screenshot tool available for all major Linux distributions. Though it seems to be no more being actively developed, it is still an excellent choice for handling screenshots. - -You might encounter certain bugs/errors. The most common problem with Shutter on any latest Linux distro releases is that the ability to edit the screenshots is disabled by default along with the missing applet indicator. But, fret not, we have a solution to that. You just need to follow our guide to[fix the disabled edit option in Shutter and bring back the applet indicator][8]. - -After you’re done fixing the problem, you can utilize it to edit the screenshots in a jiffy. - -To install shutter, you can browse the software center and get it from there. Alternatively, you can use the following command in the terminal to install Shutter in Ubuntu-based distributions: -``` -sudo apt install shutter - -``` - -As we saw with Flameshot, you can either choose to use the app launcher to search for Shutter and manually launch the application, or you can follow the same set of instructions (with a different command) to set a custom shortcut to trigger Shutter when you press the **PrtSc** key. - -If you are going to assign a custom keyboard shortcut, you just need to use the following in the command field: -``` -shutter -f - -``` - -### Method 4: Use GIMP for taking screenshots in Linux - -![][9] - -Feature Overview: - - * Advanced Image Editing Capabilities (Scaling, Adding filters, color correction, Add layers, Crop, and so on.) - * Take a screenshot of the selected area - - - -If you happen to use GIMP a lot and you probably want some advance edits on your screenshots, GIMP would be a good choice for that. - -You should already have it installed, if not, you can always head to your software center to install it. If you have trouble installing, you can always refer to their [official website for installation instructions][10]. - -To take a screenshot with GIMP, you need to first launch it, and then navigate your way through **File- >Create->Screenshot**. - -After you click on the screenshot option, you will be greeted with a couple of tweaks to control the screenshot. That’s just it. Click “ **Snap** ” to take the screenshot and the image will automatically appear within GIMP, ready for you to edit. - -### Method 5: Taking screenshot in Linux using command line tools - -This section is strictly for terminal lovers. If you like using the terminal, you can utilize the **GNOME screenshot** tool or **ImageMagick** or **Deepin Scrot** – which comes baked in on most of the popular Linux distributions. - -To take a screenshot instantly, enter the following command: - -#### GNOME Screenshot (for GNOME desktop users) -``` -gnome-screenshot - -``` - -To take a screenshot with a delay, enter the following command (here, **5** – is the number of seconds you want to delay) - -GNOME screenshot is one of the default tools that exists in all distributions with GNOME desktop. -``` -gnome-screenshot -d -5 - -``` - -#### ImageMagick - -[ImageMagick][11] should be already pre-installed on your system if you are using Ubuntu, Mint, or any other popular Linux distribution. In case, it isn’t there, you can always install it by following the [official installation instructions (from source)][12]. In either case, you can enter the following in the terminal: -``` -sudo apt-get install imagemagick - -``` - -After you have it installed, you can type in the following commands to take a screenshot: - -To take the screenshot of your entire screen: -``` -import -window root image.png - -``` - -Here, “image.png” is your desired name for the screenshot. - -To take the screenshot of a specific area: -``` -import image.png - -``` - -#### Deepin Scrot - -Deepin Scrot is a slightly advanced terminal-based screenshot tool. Similar to the others, you should already have it installed. If not, get it installed through the terminal by typing: -``` -sudo apt-get install scrot - -``` - -After having it installed, follow the instructions below to take a screenshot: - -To take a screenshot of the entire screen: -``` -scrot myimage.png - -``` - -To take a screenshot of the selected aread: -``` -scrot -s myimage.png - -``` - -### Wrapping Up - -So, these are the best screenshot tools available for Linux. Yes, there are a few more tools available (like [Spectacle][13] for KDE-based distros), but if you end up comparing them, the above-mentioned tools will outshine them. - -In case you find a better screenshot tool than the ones mentioned in our article, feel free to let us know about it in the comments below. - -Also, do tell us about your favorite screenshot tool! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/take-screenshot-linux/ - -作者:[Ankush Das][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[1]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/Taking-Screenshots-in-Linux.png -[2]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/flameshot-pic.png -[3]: https://github.com/lupoDharkael/flameshot -[4]: https://github.com/lupoDharkael/flameshot#installation -[5]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/flameshot-config-default.png -[6]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/shutter-screenshot.jpg -[7]: http://shutter-project.org/ -[8]: https://itsfoss.com/shutter-edit-button-disabled/ -[9]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/gimp-screenshot.jpg -[10]: https://www.gimp.org/downloads/ -[11]: https://www.imagemagick.org/script/index.php -[12]: https://www.imagemagick.org/script/install-source.php -[13]: https://www.kde.org/applications/graphics/spectacle/ diff --git a/translated/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md b/translated/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md new file mode 100644 index 0000000000..b8872981fe --- /dev/null +++ b/translated/tech/20180901 5 Ways to Take Screenshot in Linux [GUI and Terminal].md @@ -0,0 +1,211 @@ +5 种在 Linux 图形界面或命令行界面截图的方法 +====== +下面介绍几种获取屏幕截图并对其编辑的方法,而且其中的屏幕截图工具在 Ubuntu 和其它主流 Linux 发行版中都能够使用。 + +![在 Ubuntu Linux 中如何获取屏幕截图][1] + +当我的主力操作系统从 Windows 转换到 Ubuntu 的时候,首要考虑的就是屏幕截图工具的可用性。尽管使用默认的键盘快捷键也可以获取屏幕截图,但如果使用屏幕截图工具,可以更方便地对屏幕截图进行编辑。 + +本文将会介绍在不适用第三方工具的情况下,如何通过系统自带的方法和工具获取屏幕截图,另外还会介绍一些可用于 Linux 的最佳截图工具。 + +### 方法 1: 在 Linux 中截图的默认方式 + +你是否需要截取整个屏幕?屏幕中的某个区域?某个特定的窗口? + +如果只需要获取一张屏幕截图,不对其进行编辑的话,那么键盘的默认快捷键就可以满足要求了。而且不仅仅是 Ubuntu ,绝大部分的 Linux 发行版和桌面环境都支持以下这些快捷键: + +**PrtSc** – 获取整个屏幕的截图并保存到 Pictures 目录。 +**Shift + PrtSc** – 获取屏幕的某个区域截图并保存到 Pictures 目录。 +**Alt + PrtSc** –获取当前窗口的截图并保存到 Pictures 目录。 +**Ctrl + PrtSc** – 获取整个屏幕的截图并存放到剪贴板。 +**Shift + Ctrl + PrtSc** – 获取屏幕的某个区域截图并存放到剪贴板。 +**Ctrl + Alt + PrtSc** – 获取当前窗口的 截图并存放到剪贴板。 + +如上所述,在 Linux 中使用默认的快捷键获取屏幕截图是相当简单的。但如果要在不把屏幕截图导入到其它应用程序的情况下对屏幕截图进行编辑,还是使用屏幕截图工具比较方便。 + +#### **方法 2: 在 Linux 中使用 Flameshot 获取屏幕截图并编辑** + +![flameshot][2] + +功能概述 + + * 注释 (高亮、标示、添加文本、框选) + * 图片模糊 + * 图片裁剪 + * 上传到 Imgur + * 用另一个应用打开截图 + + + +Flameshot 在去年发布到 [GitHub][3],并成为一个引人注目的工具。如果你需要的是一个能够用于标注、模糊、上传到 imgur 的新式截图工具,那么 Flameshot 是一个好的选择。 + +下面将会介绍如何安装 Flameshot 并根据你的偏好进行配置。 + +如果你用的是 Ubuntu,那么只需要在 Ubuntu 软件中心上搜索,就可以找到 Flameshot 进而完成安装了。要是你想使用终端来安装,可以执行以下命令: +``` +sudo apt install flameshot + +``` + +如果你在安装过程中遇到问题,可以按照[官方的安装说明][4]进行操作。安装完成后,你还需要进行配置。尽管可以通过搜索来随时启动 Flameshot,但如果想使用 PrtSc 键触发启动,则需要指定对应的键盘快捷键。以下是相关配置步骤: + + * 进入系统设置中的键盘设置 + * 页面中会列出所有现有的键盘快捷键,拉到底部就会看见一个 **+** 按钮 + * 点击 “+” 按钮添加自定义快捷键并输入以下两个字段: +**名称:** 任意名称均可 +**命令:** /usr/bin/flameshot gui + * 最后将这个快捷操作绑定到 **PrtSc** 键上,可能会提示与系统的截图功能相冲突,但可以忽略掉这个警告。 + + + +配置之后,你的自定义快捷键页面大概会是以下这样: + +![][5] +将键盘快捷键映射到 Flameshot + +### **方法 3: 在 Linux 中使用 Shutter 获取屏幕截图并编辑** + +![][6] + +功能概述: + + * 注释 (高亮、标示、添加文本、框选) + * 图片模糊 + * 图片裁剪 + * 上传到图片网站 + + + +[Shutter][7] 是一个对所有主流 Linux 发行版都适用的屏幕截图工具。尽管最近已经不太更新了,但仍然是操作屏幕截图的一个优秀工具。 + +在使用过程中可能会遇到这个工具的一些缺陷。Shutter 在任何一款最新的 Linux 发行版上最常见的问题就是由于缺少了任务栏上的程序图标,导致默认禁用了编辑屏幕截图的功能。 对于这个缺陷,还是有解决方案的。下面介绍一下如何[在 Shutter 中重新打开这个功能并将程序图标在任务栏上显示出来][8]。问题修复后,就可以使用 Shutter 来快速编辑屏幕截图了。 + +同样地,在软件中心搜索也可以找到进而安装 Shutter,也可以在基于 Ubuntu 的发行版中执行以下命令使用命令行安装: +``` +sudo apt install shutter + +``` + +类似 Flameshot,你可以通过搜索 Shutter 手动启动它,也可以按照相似的方式设置自定义快捷方式以 **PrtSc** 键唤起 Shutter。 + +如果要指定自定义键盘快捷键,只需要执行以下命令: +``` +shutter -f + +``` + +### 方法 4: 在 Linux 中使用 GIMP 获取屏幕截图 + +![][9] + +功能概述: + + * 高级图像编辑功能(缩放、添加滤镜、颜色校正、添加图层、裁剪等) + * 截取某一区域的屏幕截图 + + + +如果需要对屏幕截图进行一些预先编辑,GIMP 是一个不错的选择。 + +通过软件中心可以安装 GIMP。如果在安装时遇到问题,可以参考其[官方网站的安装说明][10]。 + +要使用 GIMP 获取屏幕截图,需要先启动程序,然后通过 **File-> Create-> Screenshot** 导航。 + +打开 Screenshot 选项后,会看到几个控制点来控制屏幕截图范围。点击 **Snap** 截取屏幕截图,图像将自动显示在 GIMP 中可供编辑。 + +### 方法 5: 在 Linux 中使用命令行工具获取屏幕截图 + +这一节内容仅适用于终端爱好者。如果你也喜欢使用终端,可以使用 **GNOME 截图工具**或 **ImageMagick** 或 **Deepin Scrot**,大部分流行的 Linux 发行版中都自带这些工具。 + +要立即获取屏幕截图,可以执行以下命令: + +#### GNOME Screenshot(可用于 GNOME 桌面) +``` +gnome-screenshot + +``` + +GNOME Screenshot 是使用 GNOME 桌面的 Linux 发行版中都自带的一个默认工具。如果需要延时获取屏幕截图,可以执行以下命令(这里的 **5** 是需要延迟的秒数): + +``` +gnome-screenshot -d -5 + +``` + +#### ImageMagick + +如果你的操作系统是 Ubuntu、Mint 或其它流行的 Linux 发行版,一般会自带 [ImageMagick][11] 这个工具。如果没有这个工具,也可以按照[官方安装说明][12]使用安装源来安装。你也可以在终端中执行这个命令: +``` +sudo apt-get install imagemagick + +``` + +安装完成后,执行下面的命令就可以获取到屏幕截图(截取整个屏幕): + +``` +import -window root image.png + +``` + +这里的“image.png”就是屏幕截图文件保存的名称。 + +要获取屏幕一个区域的截图,可以执行以下命令: +``` +import image.png + +``` + +#### Deepin Scrot + +Deepin Scrot 是基于终端的一个较新的截图工具。和前面两个工具类似,一般自带于 Linux 发行版中。如果需要自行安装,可以执行以下命令: +``` +sudo apt-get install scrot + +``` + +安装完成后,使用下面这些命令可以获取屏幕截图。 + +获取整个屏幕的截图: +``` +scrot myimage.png + +``` + +获取屏幕某一区域的截图: +``` +scrot -s myimage.png + +``` + +### 总结 + +以上是一些在 Linux 上的优秀截图工具。当然还有很多截图工具没有提及(例如 [Spectacle][13] for KDE-distros),但相比起来还是上面几个工具更为好用。 + +如果你有比文章中提到的更好的截图工具,欢迎讨论! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/take-screenshot-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[1]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/Taking-Screenshots-in-Linux.png +[2]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/flameshot-pic.png +[3]: https://github.com/lupoDharkael/flameshot +[4]: https://github.com/lupoDharkael/flameshot#installation +[5]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/flameshot-config-default.png +[6]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/shutter-screenshot.jpg +[7]: http://shutter-project.org/ +[8]: https://itsfoss.com/shutter-edit-button-disabled/ +[9]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/gimp-screenshot.jpg +[10]: https://www.gimp.org/downloads/ +[11]: https://www.imagemagick.org/script/index.php +[12]: https://www.imagemagick.org/script/install-source.php +[13]: https://www.kde.org/applications/graphics/spectacle/ +