Christmas on your Linux console

We are getting closer to Christmas Eve and Christmas and here we bring you this simple Perl program with which you can decorate your terminal with the Christmas spirit.

With this program, your Linux console can look like an animated Christmas tree. Although its usefulness doesn't extend beyond the aesthetic aspect of the console, it's quite curious and something we can use during these December days. If you're reading this and interested in trying it, keep reading, and I'll explain how.

linux-christmas-tree

To view the tree in the console, you need to have Perl installed on your system (which is where the magic happens). If you already have it, you can install Acme::POE::Tree . For this installation, we must use the CPAN (Comprehensive Perl Archive Network) module. After booting with privileges, we'll write a simple command line:

perl -MCPAN -e 'install Acme::POE::Tree'

Once we do this, we will see the animated Christmas tree in the shell with a very simple command:

perl -MAcme::POE::Tree -e 'Acme::POE::Tree->new()->run()'

You can also customize this tree if you wish; simply edit the Perl script's source code and save it in a text file (for example: christmas.pl) with the following content:

#! / usr / bin / perl

use Acme :: POE :: Tree;

my $ tree = Acme :: POE :: Tree-> new (

{

star_delay => 1.5, #brightness for 1.5 seconds

light_delay => 2, #Lights blink for 2 seconds

run_for => 10, #Exit automatically after 10 seconds of sample

}

);

$ tree-> run ();

With this simple program, your console will be dressed in the Christmas spirit and, as always, we await your comments and impressions.

MERRY CHRISTMAS!!


Add as preferred source in Google