「 🦄 录制 你的 terminal 和 生成 gif 文件 , {找了好久} 」
翻译的原文 | 与日期 | 最新更新 | 更多 |
---|---|---|---|
commit | ⏰ 2018 7.31 | 中文翻译 |
欢迎 👏 勘误/校对/更新贡献 😊 具体贡献请看
If help, buy me coffee —— 营养跟不上了,给我来瓶营养快线吧! 💰
录制您的终端并生成动画 gif 图像
录制命令行 jusT cOol 👌 🦄!
如果你这么认为,请给我一个支持
star
和 afollow
😘
一边建,一边听喵喵喵😛
- 高度可定制.
- 跨平台 (Linux,Windows,MacOS) .
window frames
规则.font
规则.colors
规则.styles
与CSS
规则.- 水印.
- 在渲染之前编辑帧并调整延迟.
- 通过步长值跳过帧以减少渲染帧的数量.
- 在图像上渲染图像而不是捕获屏幕以获得更好的质量.
- 配置能力:
- 能捕获的命令终端 (bash,powershell.exe,yourOwnCommand 等)
- 当前的工作目录.
- 列和行数的显式值.
- GIF 质量和重复.
- 帧延迟.
- 帧之间的最大空闲时间.
- 光标样式.
- 字体.
- 字体大小.
- 线高.
- 字母间距.
- 主题.
- 网站来啰terminalizer.com.
- 主目录中的全局配置.
- 该
share
命令上传录制文件并获取在线播放器的链接. - 该
Generate
命令为录制文件生成 Web 播放器.
你需要先安装Node.js,使用此命令全局安装该工具:
npm install -g terminalizer
仍然面临一个问题?检查问题部分或打开一个新问题.
如果安装失败,您可能需要安装开发工具来构建C++
插件.
C++
需要建筑的插件. 在我们发布第一个包含针对不同操作系统的预构建二进制文件的稳定版本之前,您可能需要安装一些工具来构建. 尝试以下操作,如果它们无法解决您的安装问题,请检查https://github.com/nodejs/node-gyp#installation.
对于 MacOS
xcode-select --install
对于 RHEL,CentOS,Scientific Linux,Fedora
yum update
yum groupinstall "Development Tools"
对于 Debian,Ubuntu 和衍生品
sudo apt-get update
sudo apt-get install build-essential
对于 openSUSE/SUSE
zypper refresh
zypper update
zypper install -t pattern devel_C_C++
适用于 Arch Linux 及其衍生产品
sudo pacman -Syyu
sudo pacman -S base-devel
验证安装
gcc -v
make -v
使用开始录制终端record
命令.
terminalizer record demo
一个名为的文件demo.yml
将在当前目录中创建. 您可以使用任何编辑器打开它来编辑配置和录制的帧. 您可以使用以下内容重播录制内容play
命令.
terminalizer play demo
现在让我们将我们的录音呈现为 GIF 动画.
terminalizer render demo
GIF 压缩尚未实施. 现在我们推荐https://gifcompressor.com.
你可以使用
--help
选项以获取有关命令及其选项的更多详细信息
terminalizer <command> [options]
在当前目录中生成配置文件
terminalizer config
录制终端并创建录制文件
terminalizer record <recordingFile>
选项
-c, --config Overwrite the default configurations [string]
-d, --command The command to be executed [string] [default: null]
例子
terminalizer record foo Start recording and create a recording file called foo.yml
terminalizer record foo --config config.yml Start recording with your own configurations
在终端上播放录音文件
terminalizer play <recordingFile>
选项
-r, --real-timing Use the actual delays between frames as recorded [boolean] [default: false]
-s, --speed-factor Speed factor, multiply the frames delays by this factor [number] [default: 1]
将录制文件渲染为动画 gif 图像
terminalizer render <recordingFile>
选项
-o, --output A name for the output file [string]
-q, --quality The quality of the rendered image (1 - 100) [number]
-s, --step To reduce the number of rendered frames (step > 1) [number] [default: 1]
上传录制文件并获取在线播放器的链接
terminalizer share <recordingFile>
为录制文件生成 Web 播放器
terminalizer generate <recordingFile>
默认值config.yml
文件存储在项目的根目录中. 执行以下命令将其复制到当前目录.
使用任何编辑器编辑复制的
config.yml
,然后使用-c
选项以覆盖默认值.
terminalizer config
command
: 指定要执行的命令/bin/bash -l
,ls
或任何其他命令. 默认是bash
对于Linux
要么powershell.exe
对于Windows
.cwd
: 指定当前工作目录路径. 默认值是当前工作目录路径.env
: 导出其他 ENV 变量,在开始录制时由脚本读取.cols
: 显式设置列数或使用auto
获取 shell 的当前列数.rows
: 显式设置行数或使用auto
获取 shell 的当前行数.
frameDelay
: 以 ms 为单位的帧之间的延迟. 如果值是auto
使用实际录制延迟.maxIdleTime
: 帧之间的最大延迟 (ms) . 如果被忽略了frameDelay
未设置为auto
. 设置auto
防止限制最大空闲时间.
quality
: 生成的 GIF 图像的质量 (1 - 100) .repeat
: 重复 GIF 的次数:- 如果价值是
-1
,玩一次. - 如果价值是
0
,无限循环. - 如果 value 是正数,则循环
n
倍.
- 如果价值是
cursorStyle
: 光标样式可以是其中之一block
,underline
, 要么bar
.fontFamily
: 您可以使用计算机上安装的任何字体Monaco
要么Lucida Console
(类似 CSS 的列表) .fontSize
: 字体的大小 (以像素为单位) .lineHeight
: 以像素为单位的线条高度.letterSpacing
: 字母之间的间距,以像素为单位.
您可以使用以下 CSS 格式之一设置终端的颜色:
- 十六进制:
#FFFFFF
. - RGB:
rgb(255, 255, 255)
. - HSL:
hsl(0, 0%, 100%)
. - 名称:
white
,red
,blue
.
您可以使用该值
transparent
太.
分配给终端颜色的默认颜色为:
- background:
transparent
- foreground:
#afafaf
- cursor:
#c7c7c7
- black:
#232628
- red:
#fc4384
- green:
#b3e33b
- yellow:
#ffa727
- blue:
#75dff2
- magenta:
#ae89fe
- cyan:
#708387
- white:
#d5d5d0
- brightBlack:
#626566
- brightRed:
#ff7fac
- brightGreen:
#c8ed71
- brightYellow:
#ebdf86
- brightBlue:
#75dff2
- brightMagenta:
#ae89fe
- brightCyan:
#b1c6ca
- brightWhite:
#f9f9f4
您可以在生成的 GIF 图像中添加水印徽标.
watermark:
imagePath: AbsolutePathOrURL
style:
position: absolute
right: 15px
bottom: 15px
width: 100px
opacity: 0.9
watermark.imagePath
: 计算机上图像的绝对路径或 URL.watermark.style
: 将 CSS 样式 (camelCase) 应用于水印图像,如调整大小.
终结器附带预定义的框架,您可以使用它们使您的 GIF 图像看起来很酷.
frameBox.type
: 可null
,window
,floating
, 要么solid
.frameBox.title
: 显示框架或标题null
.frameBox.style
: 应用自定义 CSS 样式或覆盖当前样式.
没有框架,只有你的录制.
别忘了添加一个
backgroundColor
下style
.
frameBox:
type: null
title: null
style:
backgroundColor: black
frameBox:
type: window
title: Terminalizer
style: []
frameBox:
type: floating
title: Terminalizer
style: []
frameBox:
type: solid
title: Terminalizer
style: []
frameBox:
type: solid
title: null
style: []
您可以禁用默认阴影和边距.
frameBox:
type: solid
title: null
style:
boxShadow: none
margin: 0px
为 Linux 录制的默认命令是bash -l
. 您需要将默认命令更改为zsh
.
- 在当前目录中生成配置文件
terminalizer config
-
在首选编辑器中打开生成的配置文件.
-
改变
command
至zsh
:command: zsh
-
您可能需要更改字体,检查终端中使用的字体:
fontFamily: "Meslo for Powerline, Meslo LG M for Powerline"
-
使用
-c
覆盖配置文件的选项:
terminalizer record demo -c config.yml
加载共享库时出错: libXss.so.1: cannot open shared object file: No such file or directory
解:
sudo yum install libXScrnSaver
加载共享库时出错: libgconf-2.so.4: cannot open shared object file: No such file or directory
解:
sudo apt-get install libgconf-2-4
该项目受 MIT 许可.