GIF (Graphics Interchange Format) is a nice thing that shows a few frames one after another. If you’re on Linux, it’s really easy for you to capture a part of your screen and turn it into GIF format. There are many possible usage of this trick. For example, sharing step-by-step tutorial or having fun. In cases, I also used this method to create some nice memes. Jokes aside, let’s take a look how to do this magic.
For recording your screen, you need a tool named “Peek”. It doesn’t come pre-installed in Linux distros, but follow these simple steps to install it in your system.
Ubuntu & Ubuntu-based distros
If you’re on Ubuntu and other Ubuntu-based distros, run these commands to install it on your system. I’m a Linux Mint (Ubuntu-based distro) user, so the screenshots are on Linux Mint.
Run these commands:
sudo add-apt-repository ppa:peek-developers/stable sudo apt update sudo apt install peek
The first line will install the PPA to the system, second will refresh + update the resource catalog and the third line will install the tool.
If you’re on Debian, you need to build “Peek” from the source into an installable DEB package. Follow these steps.
- Install all the necessary tools with this command:
sudo apt-get install cmake valac libgtk-3-dev libkeybinder-3.0-dev libxml2-utils gettext txt2man git
- Run these commands to start building the app on your system.
git clone https://github.com/phw/peek.git mkdir peek/build cd peek/build cmake -DCMAKE_INSTALL_PREFIX=/usr -DGSETTINGS_COMPILE=OFF .. make package
- If you followed things correctly, there should be an installable DEB file into the directory. Install it using this command:
sudo dpkg -i peek-*-Linux.deb [ * = the version of the package]
Arch is one of the major distributions and a higher grade Linux. In order to install Peek, you have to build it in your system.
Run this command:
git clone https://aur.archlinux.org/peek.git cd peek
Now, it’s time to build and install the package. Run this command:
If you’re on Fedora, you have to install Peek from the RPM Fusion Free software repository. It’s a place where apps not available on Fedora’s official repository are stored. Run this command to install the latest Peek.
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-X.noarch.rpm [Change X with your Fedora version] dnf copr enable dani/peek sudo dnf install peek ffmpeg gstreamer1-plugins-ugly
If you don’t find Peek for your Linux distro, consider using Flatpak. It’s a simple way to make apps available in a wider range of Linux distros. You can get the detailed Flatpak setup guide for your Linux here. Then, run this command:
flatpak install --user https://flathub.org/repo/appstream/com.uploadedlobster.peek.flatpakref
After installation is complete, run Peek by using this command:
flatpak run com.uploadedlobster.peek
It’s time to use Peek into your system. First, launch Peek from the Applications. It’ll ask for scaling the screen’s area to record. When you’re ready, click the “Record” button.
When you’re finished, press the “Stop” button. You’ll have the option to save the GIF file in a directory.
You might not know, but Peek allows to record screen in other formats! Yes, you can record your screen in MP4, WebM and APNG formats. To select them, click the drop-down icon next to “Record to GIF” button.