Screenshot from console on Raspberry Pi

I’m building a fleet of distributed Raspberry multimedia players and I’ve decided to start with a few terminal commands to manage them.

Let’s begin with a screenshot of current screen contents.

Firstly neither scroot or gwd didin’t work for me. All I’ve got from those commands was black png file. So you’ll need to install raspi2png.

curl -sL https://raw.githubusercontent.com/AndrewFromMelbourne/raspi2png/master/installer.sh | bash -

And voilà this is it. You can capture your screen to file.

To create one try this command:

raspi2png -w 1280 -h 720 -d 1

This will create snapshot.png in current directory.

What about ascii console output?

Nice, huh?

To achieve that install jp2a package:

sudo apt-get update && sudo apt-get install -y jp2a imagemagick

After sucessfull install try this command:

raspi2png -w 1280 -h 720 -d 1 -s | convert - jpg:- | jp2a --color --width=200 -

You can add screenshot to your aliases:

nano ~/.bash_aliases

Code:

alias screenshot='raspi2png -h 720 -w 1280 -d 1 -s | convert - jpg:- | jp2a --color --width=200 -'
I am the Raspininja™

Published by

Konrad Fedorczyk

Konrad Fedorczyk

I'm interested in programming and gamedev. I especially luv HTML5 and everything connected to web technologies.

Leave a Reply

Your email address will not be published. Required fields are marked *