Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/icholy/ttygif
Convert terminal recordings to animated gifs
https://github.com/icholy/ttygif
gifs terminal
Last synced: 2 days ago
JSON representation
Convert terminal recordings to animated gifs
- Host: GitHub
- URL: https://github.com/icholy/ttygif
- Owner: icholy
- License: mit
- Created: 2013-08-12T16:31:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-09-02T15:49:45.000Z (over 1 year ago)
- Last Synced: 2024-10-29T15:34:36.852Z (2 months ago)
- Topics: gifs, terminal
- Language: C
- Homepage:
- Size: 136 KB
- Stars: 3,947
- Watchers: 63
- Forks: 255
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- my-awesome - icholy/ttygif - 01 star:4.0k fork:0.3k Convert terminal recordings to animated gifs (C)
- awesome-speaker - ttygif - Convert terminal recordings to animated gifs (Source Code Tools)
- favorite-link - 将终端记录转换为 GIF 动画。
- my-awesome-github-stars - icholy/ttygif - Convert terminal recordings to animated gifs (C)
- awesome-starred - icholy/ttygif - Convert terminal recordings to animated gifs (terminal)
README
![](ttygif.png)
> ttygif converts a ttyrec file into gif files.
> It's a stripped down version of ttyplay that screenshots every frame.## Demo
![gif](http://i.imgur.com/nvEHTgn.gif)
## Setup
### Debian/Ubuntu
``` sh
$ sudo apt-get install imagemagick ttyrec gcc x11-apps make git
$ git clone https://github.com/icholy/ttygif.git
$ cd ttygif
$ make
$ sudo make install
```### Fedora/CentOS/RHEL
``` sh
$ sudo dnf install ImageMagick gcc xorg-x11-apps
$ # install ttyrec from source patched ~> https://github.com/mattwilmott/ttyrec
$ git clone https://github.com/icholy/ttygif.git
$ cd ttygif
$ make
$ sudo make install
```### OpenSUSE Leap
```sh
$ zypper addrepo http://download.opensuse.org/repositories/utilities/openSUSE_Leap_42.2/utilities.repo
$ zypper refresh
$ zypper install ttygif
```### Arch Linux
``` sh
$ git clone https://aur.archlinux.org/ttyrec.git
$ cd ttyrec
$ makepkg -i
$ cd ..
$ git clone https://aur.archlinux.org/ttygif.git
$ cd ttygif
$ makepkg -is
```With yaourt installed:
```sh
$ yaourt -S ttyrec ttygif
```### macOS
``` sh
$ brew install ttygif
```## Usage:
**1. Create ttyrec recording**
``` sh
$ ttyrec myrecording
```* Hit CTRL-D or type `exit` when done recording.
**2. Convert to gif**
``` sh
$ ttygif myrecording
```On OSX optionally you can set a -f flag which will bypass cropping which is needed for terminal apps which aren't full screen.
Both standard Terminal and iTerm apps are supported.``` sh
$ ttygif myrecording -f
```## Additional Notes
If you're getting `Error: WINDOWID environment variable was empty.`, then you need to manually set `WINDOWID`.
``` sh
export WINDOWID=23068679
```If you're on Ubuntu, you can use `xdotool` to find the WINDOWID
``` sh
$ sudo apt-get install xdotool
$ export WINDOWID=$(xdotool getwindowfocus)
```## Debugging
If you're having issues, then export the `TTYGIF_DEBUG` env variable.
``` sh
export TTYGIF_DEBUG=1
```This will print out all the commands it's trying to run.
## Credits
The idea and approach was adapted from [tty2gif](https://bitbucket.org/antocuni/tty2gif)
![](http://i.imgur.com/9et8daN.jpg)