Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


Shell recording

Reference(s)

Table of contents


script + scriptreplay + byzanz or congif

  • byzanz is a small and efficient screencast creator. It records your desktop session or parts of it to an animated GIF, Ogg Theora or Flash.
# pacman -S byzanz
# apt install byzanz
# yum install byzanz
# dnf install byzanz
  • config generates GIF animations of console sessions. Like scriptreplay, it reads the output of script, including timing information. Unlike scriptreplay, congif parses the session dialogue and encodes it as a GIF animation that can be viewed on graphical programs. See https://github.com/lecram/congif.

byzanz will record

The convert program is a member of the ImageMagick

$ convert -size 1920x1080 canvas:black /tmp/black.png
$ feh --bg-fill --no-fehbg /tmp/black.png

$ script --log-timing file.tm --log-out script.out
    > Script started, file is script.out
$ ttyrec -f record.ttyrec
$ ls
    > ...
$ echo "test"
    > ...
$ exit
$ exit
    > Script done, file is script.out

$ rm record.ttyrec

$ scriptreplay --maxdelay 0.1 --log-timing file.tm --log-out script.out

$ byzanz-record --exec 'scriptreplay --maxdelay 0.1 --log-timing file.tm --log-out script.out' byzanz-record.gif

Note

You can get the current mouse position with xev.

  • recording the top right corner of a 1920x1080 screen:

    $ byzanz-record -x 960 -w 960 -y 0 -h 540 --exec 'scriptreplay --maxdelay 0.1 --log-timing file.tm --log-out script.out' byzanz-record.gif
    

  • recording the left side of a 1920x1080 screen:

    $ byzanz-record -x 0-w 960 -y 0 -h 1080 --exec 'scriptreplay --maxdelay 0.1 --log-timing file.tm --log-out script.out' byzanz-record.gif
    


ttyrec + ttygif

  • ttyrec is a terminal recorder (and ttyplay is a terminal player).
  • ttygif converts a ttyrec file into GIF files. It's a stripped down version of ttyplay that screenshots every frame.
Reference(s)

install ttyrec

$ git clone https://aur.archlinux.org/ovh-ttyrec-git.git
$ cd ovh-ttyrec-git
$ makepkg -si

$ git clone https://github.com/ovh/ovh-ttyrec
$ git checkout v1.1.6.7 # checkout to the latest release (v1.1.6.7 at the time of writing)
$ ./configure && make
Optionally you can also run $ make install if you want, or add ttrec, ttyplay and ttytime to your $PATH variable. But note that is not needed to use the binaries: you can just run ./ttyrec (or ./ttyplay, ttytime) from the build folder.

install ttygif

$ git clone https://aur.archlinux.org/ovh-ttyrec-git.git
$ cd ovh-ttyrec-git
$ makepkg -si
$ cd ..
$ git clone https://aur.archlinux.org/ttygif.git
$ cd ttygif
$ makepkg -si

TODO

use

  • record:

    $ ttyrec -f record.ttyrec
    $ ls
        > ...
    $ echo "test"
        > ...
    $ exit
    

  • replay in shell:

    $ ttyplay record.ttyrec
    

  • create GIF from record:

    $ ttygif record.ttyrec
    


asciinema + asciicast2gif

asciinema is terminal session recorder.

Reference(s)

install

$ sudo pacman -S asciinema

TODO

use

$ asciinema rec -i 0.1 record.cast

If this cheat sheet has been useful to you, then please consider leaving a star here.