Minecraft Pi Screenshot - Revisited


A long time ago I wrote a simple install script for an existing Minecraft screenshot tool called raspi2png developed by Andrew from Melbourne.
My script served a purpose, in that it automated the install of the tool which I routinely used for magazine articles.
Today I revisited the script and refined it.

The Script


The install script is really a BASH script, a script used on Linux/Unix machines to automate a process. System administrators use them quite a lot to make their lives easier. The script uses a menu system called whiptail, used for the Raspberry Pi Config tool and installed as standard in Raspbian.
Whiptail is an old menu system, but it does a great job of controlling the install.

The script installs a package called libpng12-dev which handles creating png files. We then create a new directory to store our downloads. We then download the install file and unzip the contents. Next we copy the raspi2png file into /usr/bin enabling any user to access the command. Lastly we modify the raspi2png file so that it can be executed as an application.

How do I install this?

Well dear reader I have created a one line bash command that will download, modify and install the tools all from just one line of code!

Copy the following into a Terminal and press Enter to run. Please note that this is ONE LINE of code.

wget bit.ly/MinecraftPi_Screenshot -O install.sh && chmod +x install.sh && ./install.sh  

The BASH code starts by downloading the install.sh script from GitHub, then renaming it via -O to install.sh. We then use && which is a Linux shorthand for
If the first part of the command completes correctly, move on to the next part So if the download works correctly then we use chmod +x to modify the permissions of the install.sh file so that it can be executed. We then use another && to run the install.sh file that is now executable....all in one line of BASH, admittedly a long line! :)


Installing via a script like this is safe from me as I am a nice person and wish no harm. BUT there are lots of people who like to be funny or cause harm, so don't trust an install script from websites in general. Download and read the contents of the script and then consider installation.

How can I use it?

To take a screenshot

Where x is the duration in seconds that raspi2png will wait before taking the picture.
And where y is the filename to save as, for example image1.png

raspi2png -d x -p y.png  

Hey Presto!!


Hey Les, where's the code? I want to take a look

All of the code is on GitHub and you are free to raise issues, suggestions, fork etc