mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-24 02:20:09 +08:00
commit
f12aec5faf
@ -1,59 +1,57 @@
|
||||
translating---geekpi
|
||||
|
||||
Kgif – A Simple Shell Script to Create a Gif File from Active Window
|
||||
Kgif - 一个从活动窗口创建 GIF 的简单脚本
|
||||
============================================================
|
||||
|
||||
[Kgif][2] is a simple shell script which create a Gif file from active window. I felt this app especially designed to capture the terminal activity. I personally used, very often for that purpose.
|
||||
[Kgif][2] 是一个简单的 shell 脚本,它可以从活动窗口创建一个 GIF 文件。我觉得这个程序专门是为捕获终端活动设计的。我经常用于这个。
|
||||
|
||||
It captures activity as a series of PNG images, then combines all together to create a animated GIF. The script taking a screenshot of the active window at 0.5s intervals. If you feel, its not matching your requirement, straight away you can modify the script as per your need.
|
||||
它将活动捕获为一系列的 PNG 图片,然后组合在一起创建一个GIF 动画。脚本以 0.5s 的间隔截取活动窗口。如果你觉得这不符合你的要求,你可以根据你的需要修改脚本。
|
||||
|
||||
Originally it was created for capturing tty output and creating preview for github projects.
|
||||
最初它是为了捕获 tty 输出以及创建 github 项目的预览图创建的。
|
||||
|
||||
Make sure you have installed scrot and ImageMagick packages before running Kgif.
|
||||
确保你在运行 Kgif 之前已经安装了 scrot 和 ImageMagick 软件包。
|
||||
|
||||
Suggested Read : [Peek – Create a Animated GIF Recorder in Linux][3]
|
||||
推荐阅读:[Peek - 在 Linux 中创建一个 GIF 动画录像机] [3]
|
||||
|
||||
What’s ImageMagick ImageMagick is a command line tool which used for image conversion and editing. It support all kind of image formats (over 200) such as PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG.
|
||||
什么是 ImageMagick?ImageMagick 是一个命令行工具,用于图像转换和编辑。它支持所有类型的图片格式(超过 200 种),如 PNG、JPEG、JPEG-2000、GIF、TIFF、DPX、EXR、WebP、Postscript、PDF 和 SVG。
|
||||
|
||||
What’s Scrot Scrot stand for SCReenshOT is an open source, command line tool to capture a screen shots of your Desktop, Terminal or a Specific Window.
|
||||
什么是 Scrot?Scrot 代表 SCReenshOT,它是一个开源的命令行工具,用于捕获桌面、终端或特定窗口的屏幕截图。
|
||||
|
||||
#### Install Dependencies
|
||||
#### 安装依赖
|
||||
|
||||
Kgif required scrot and ImageMagick to work.
|
||||
Kgif 需要 scrot 以及 ImageMagick。
|
||||
|
||||
For Debian based Systems
|
||||
对于基于 Debian 的系统:
|
||||
|
||||
```
|
||||
$ sudo apt-get install scrot imagemagick
|
||||
```
|
||||
|
||||
For RHEL/CentOS based Systems
|
||||
对于基于 RHEL/CentOS 的系统:
|
||||
|
||||
```
|
||||
$ sudo yum install scrot ImageMagick
|
||||
```
|
||||
|
||||
For Fedora Systems
|
||||
对于 Fedora 系统:
|
||||
|
||||
```
|
||||
$ sudo dnf install scrot ImageMagick
|
||||
```
|
||||
|
||||
For openSUSE Systems
|
||||
对于 openSUSE 系统:
|
||||
|
||||
```
|
||||
$ sudo zypper install scrot ImageMagick
|
||||
```
|
||||
|
||||
For Arch Linux based Systems
|
||||
对于基于 Arch Linux 的系统:
|
||||
|
||||
```
|
||||
$ sudo pacman -S scrot ImageMagick
|
||||
```
|
||||
|
||||
#### Install Kgif & Usage
|
||||
#### 安装 Kgif 及使用
|
||||
|
||||
Installation of Kgif not a big deal because no installation required. Just clone the source file from developer github page wherever you want and run the `kgif.sh` file to capture the active window. By default, it’s sets delay to 1 sec, you can modify this by including `--delay` option with kgif. Finally press `Ctrl+c` to stop capturing.
|
||||
安装 Kgif 并不困难,因为不需要安装。只需从开发者的 github 页面克隆源文件,你就可以运行 `kgif.sh` 文件来捕获活动窗口了。默认情况下它的延迟为 1s,你可以用 `--delay` 选项来修改延迟。最后,按下 “Ctrl + c” 来停止捕获。
|
||||
|
||||
```
|
||||
$ git clone https://github.com/luminousmen/Kgif
|
||||
@ -69,7 +67,7 @@ Cleaning...
|
||||
Done!
|
||||
```
|
||||
|
||||
Check whether dependencies are presents in system.
|
||||
检查系统中是否已存在依赖。
|
||||
|
||||
```
|
||||
$ ./kgif.sh --check
|
||||
@ -77,7 +75,7 @@ OK: found scrot
|
||||
OK: found imagemagick
|
||||
```
|
||||
|
||||
Set delay in seconds with script to start capturing, after N seconds.
|
||||
设置在 N 秒延迟后开始捕获。
|
||||
|
||||
```
|
||||
$ ./kgif.sh --delay=5
|
||||
@ -92,7 +90,7 @@ Cleaning...
|
||||
Done!
|
||||
```
|
||||
|
||||
It save the gif file name as a `terminal.gif` and overwrite every time whenever get a new file. So, i advise you to add `--filename`option to save the file in a different name.
|
||||
它会将文件保存为 `terminal.gif`,并且每次在生成新文件时都会覆盖。因此,我建议你添加 `--filename` 选项将文件保存为不同的文件名。
|
||||
|
||||
```
|
||||
$ ./kgif.sh --delay=5 --filename=2g-test.gif
|
||||
@ -107,13 +105,13 @@ Cleaning...
|
||||
Done!
|
||||
```
|
||||
|
||||
Set noclean with script to keep the source png screen shots.
|
||||
使用 noclean 选项保留 png 截图。
|
||||
|
||||
```
|
||||
$ ./kgif.sh --delay=5 --noclean
|
||||
```
|
||||
|
||||
To know more all the options.
|
||||
要了解更多的选项。
|
||||
|
||||
```
|
||||
$ ./kgif.sh --help
|
||||
@ -127,12 +125,12 @@ usage: ./kgif.sh [--delay] [--filename ] [--gifdelay] [--noclean] [--check] [-h]
|
||||
--noclean Set if you don't want to delete source *.png screenshots.
|
||||
```
|
||||
|
||||
Default capturing output.
|
||||
默认捕获输出。
|
||||
[
|
||||

|
||||
][4]
|
||||
|
||||
I felt, the default capturing is very fast, then i made few changes and got the proper output.
|
||||
我感觉默认的捕获非常快,接着我做了一些修改并得到了合适的输出。
|
||||
[
|
||||

|
||||
][5]
|
||||
@ -142,7 +140,7 @@ I felt, the default capturing is very fast, then i made few changes and got the
|
||||
via: http://www.2daygeek.com/kgif-create-animated-gif-file-active-window-screen-recorder-capture-arch-linux-mint-fedora-ubuntu-debian-opensuse-centos/
|
||||
|
||||
作者:[MAGESH MARUTHAMUTHU][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user