Screen capture

This article lists and describes screenshot and screencast software.

Screenshot software

Dedicated software

  • CoreShot Simple lightweight screen capture utility for X11. Part of C-Suite.
https://cubocore.org/ || coreshotAUR
  • Deepin Screenshot Quite easy-to-use screenshot tool, now deprecated and merged into Deepin Screen Recorder. A known issue with the clipboard functionality is patched by deepin-screenshot-copy-patchAUR.
https://www.deepin.org/en/original/deepin-screenshot/ || deepin-screenshot
  • Escrotum Screen capture using python and gtk3, inspired by scrot.
https://github.com/Roger/escrotum || escrotum-gitAUR
  • Flameshot Qt5 based software for interactive screenshot taking. Select the desired area, draw with different tools and enjoy the customization capabilities.
https://github.com/lupoDharkael/flameshot || flameshot
https://gitlab.gnome.org/GNOME/gnome-screenshot/ || gnome-screenshot
  • grim Grab images from a Wayland compositor.
https://github.com/emersion/grim || grim
  • gscreenshot Simple GTK screenshot utility with delays, selection, and copy-to-clipboard functionality.
https://github.com/thenaterhood/gscreenshot || gscreenshotAUR
  • HotShots Application for capturing screens and saving them in a variety of image formats as well as adding annotations and graphical data (arrows, lines, texts, ...).
https://github.com/obiwankennedy/HotShots || hotshots-gitAUR
  • LXQt Screenshot Screenshot tool for LXQt. Run with lximage-qt --screenshot.
https://github.com/lxde/lximage-qt || lximage-qt
  • maim Simple command line utility that takes screenshots. It is meant to replace scrot and performs better than scrot in many ways.
https://github.com/naelstrof/maim || maim
  • Shotgun Minimal X screenshot utility written in Rust. According to the author it is twice as fast as maim.
https://github.com/neXromancers/shotgun || shotgun
  • xwd X Window System image dumping utility
https://www.x.org/ || xorg-xwd

xwd

is provided by .

To take a screenshot of the root window:

$ xwd -root -out screenshot.xwd

scrot

enables taking screenshots from the CLI and offers features such as a user-definable time delay. Unless instructed otherwise, it saves the file in the current working directory.
$ scrot -t 20 -d 5

The above command saves a dated .png file, along with a thumbnail (20% of original), for Web posting. It provides a 5 second delay before capturing in this instance.

You can also use standard date and time formatting when saving to a file. e.g.,

$ scrot ~/screenshots/%Y-%m-%d-%T-screenshot.png

saves the screenshot in a filename with the current year, month, date, hours, minutes, and seconds to a folder in your home directory called "screenshots"

See for more information. You can simply automate the file to uploaded like so .

escrotum

screen capture using PyGTK, inspired by scrot

Created because scrot has glitches when selection mode is used with refreshing windows.

Because the command line interface its almost the same as scrot, can be used as a replacement of it.

maim

maim is aimed to be an improved scrot.

Save the full screen to file:

$ maim filename

Prompt for selection and save to file:

$ maim --select filename

Save the active window to file, assuming is installed:

$ maim --window $(xdotool getactivewindow) filename

Prompt for selection, save without cursor, and store it to clipboard, assuming xclip is installed:

$ maim -s | xclip -selection clipboard -t image/png -i

Spectacle

If you use KDE, you might want to use .

Spectacle is provided by the package.

Xfce Screenshooter

If you use Xfce you can install and then add a keyboard binding:

Xfce Menu > Settings > Keyboard > Application Shortcuts

If you want to skip the Screenshot prompt, type in terminal for the options.

GNOME

GNOME users can press or Apps > Accessories > Take Screenshot. You may need to install .

GNOME features built-in screen recording with the key combination. A red circle is displayed in the bottom right corner of the screen when the recording is in progress. After the recording is finished, a file named Screencast from %d%u-%c.webm is saved in the directory. In order to use the screencast feature the gst plugins need to be installed.

Cinnamon

The default installation of Cinnamon does not provide a screenshot utility. Installing will enable screenshots through the Menu > Accessories > Screenshot or by pressing .

Other desktop environments or window managers

For other desktop environments such as LXDE or window managers such as Openbox and Compiz, one can add the above commands to the hotkey to take the screenshot. For example,

$ import -window root ~/Pictures/$(date '+%Y%m%d-%H%M%S').png

Note that is part of the package. Adding the above command to the key to Compiz allows to take the screenshot to the Pictures folder according to date and time. Notice that the rc.xml file in Openbox does not understand commas; so, in order to bind that command to the key in Openbox, you need to add the following to the keyboard section of your rc.xml file:

If the above does not work, see Extra keyboard keys and use different keysym or keycode.

ImageMagick/GraphicsMagick

See ImageMagick#Screenshot taking.

GIMP

You also can take screenshots with GIMP (File > Create > Screenshot...).

imlib2

provides a binary  to take screenshots. To take a screenshot of the full screen, type:
$ imlib2_grab screenshot.png

FFmpeg

See FFmpeg#Screen capture.

Screencast software

See also FFmpeg#Screen capture and Wikipedia:Comparison of screencasting software.

Screencast utilities allow you to create a video of your desktop or individual windows.

  • Deepin Screen Recorder Screen recorder application for Deepin desktop.
https://www.deepin.org/en/original/deepin-screen-recorder/ || deepin-screen-recorder
  • screencast Command line interface to record an X11 desktop using FFmpeg, having support for offline recording and live streaming.
https://github.com/dbermond/screencast/ || screencastAUR

Wayland

Capturing the screen on Wlroots-based compositor can be done using or grimshot (provided by ) for screenshots and (or wf-recorder-gitAUR) for video; is an plugin that allows you to screen capture on wlroots-based compositors. Optionally, slurp can be used to select the part of the screen to capture.

Take a screenshot of the whole screen:

$ grim screenshot.png

Take a screenshot of current window:

$ grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')" screenshot.png

Take a screenshot of a part of the screen:

$ grim -g "$(slurp)" screenshot.png

Take a screenshot of a part of the screen and put the output into the clipboard using :

$ grim -g "$(slurp)" - | wl-copy

Capture a video of the whole screen:

$ wf-recorder -f recording.mp4

Capture a video of a part of the screen:

$ wf-recorder -g "$(slurp)"

Additionally, some programs mentioned above work under Wayland (e.g. , ). For KDE’s to work properly, you may have to delete ; in any case, Spectacle should work with Window Under Cursor (Meta+Ctrl+Print) selected in Caption Mode Area.

Tmate

To capture your terminal(s) in wl-roots based compositor like wayland, use , then copy your ssh key and send it to your mate. For further information see tmate(1)

Via GNOME screencast

, obs-gnome-screencastAUR and support screen recording on Wayland using GNOME screencast feature.

Via a virtual webcam video feed

Install (or wf-recorder-gitAUR) and . Load the kernel module with the following parameters:

# modprobe v4l2loopback exclusive_caps=1 card_label=VirtualVideoDevice

Verify that a new virtual video device VirtualVideoDevice has been created:

Start recording the screen with and feed the output to the new virtual video device VirtualVideoDevice created by :

$ wf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video2 -x yuv420p

The colour space is required for the video output to be compatible with Zoom .

You can now select the above virtual video device as your "webcam" in video calling/video conferencing applications (the device is called VirtualVideoDevice). You can use (part of ), mpv, or (part of ) to verify that the virtual video device indeed outputs your screenshare:

$ ffplay /dev/video2
$ mpv av://v4l2:/dev/video2
$ gst-launch-1.0 -v v4l2src device=/dev/video2 ! glimagesink

If Firefox is unable to read the video stream and prints a message like "AbortError: Starting video failed", try preloading :

$ LD_PRELOAD=/usr/lib/v4l1compat.so firefox
Sharing individual applications

As explained above, is able to record only a portion of the screen by first selecting a region with slurp. To use this functionality for sharing a specific region/application window through a virtual video device, start recording the screen with the following modified command:

$ wf-recorder -g "$(slurp)" --muxer=v4l2 --codec=rawvideo --file=/dev/video2 -x yuv420p

After selecting a region of the screen, you will be able to access the video feed through the virtual video device /dev/video2 as above.

Via the WebRTC protocol

See PipeWire#WebRTC screen sharing.

Chromium and Firefox should now be able to access the screenshare. You can verify this through Mozilla's getUserMedia / getDisplayMedia Test Page.

Terminal

Capture with ANSI codes

You can use the command, part of the package. Just run script and from that moment, all the output is going to be saved to the file, including the ANSI codes.

Once you are done, just run and the would ready. The resulting file can be converted to HTML using the package (not to be confused with ansi2html from ).

To convert the file to , do the following:

$ ansi2html --bg=dark < typescript > typescript.html

Actually, some commands can be piped directly to ansi2html:

$ ls --color|ansi2html --bg=dark >output.html

That does not work on every single case, so in those cases, using script is mandatory.

Framebuffer

Install a framebuffer and use or fbdump to take a screenshot.

Virtual console

If you merely want to capture the text in the console and not an actual image, you can use , which is part of the package. The following command will dump the textual contents of virtual console 1 to a file in the current directory:

# setterm -dump 1 -file screen.dump

Root permission is needed because the contents of /dev/vcs1 need to be read.

gollark: Shouldn't that be a ParserResult or something?
gollark: Nobody will notice.
gollark: Just have a global "error data" variable.
gollark: Why wouldn't it be?
gollark: ...
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.