Linux/Unix desktop fun: Christmas tree on the terminal
Create a Christmas tree for your Linux or Unix console. Before that, install a Perl module named "Acme: POE: Tree. This is a very festive Christmas tree. I have verified it on Linux, OSX, and Unix-like systems.
Install Acme: POE: Tree
The simplest way to install the perl module is to use CPAN (Perl integrated collection Network (Comprehensive Perl Archive Network )). Open the terminal and press the following command to install Acme: POE: Tree.
### Run as root ###
perl -MCPAN -e 'install Acme::POE::Tree'
Sample output:
Installing/home/vivek/perl5/man/man3/POE::NFA.3pm
Installing/home/vivek/perl5/man/man3/POE::Kernel.3pm
Installing/home/vivek/perl5/man/man3/POE::Loop.3pm
Installing/home/vivek/perl5/man/man3/POE::Resource.3pm
Installing/home/vivek/perl5/man/man3/POE::Filter::Map.3pm
Installing/home/vivek/perl5/man/man3/POE::Resource::SIDs.3pm
Installing/home/vivek/perl5/man/man3/POE::Loop::IO_Poll.3pm
Installing/home/vivek/perl5/man/man3/POE::Pipe::TwoWay.3pm
Appending installation info to /home/vivek/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod
RCAPUTO/POE-1.367.tar.gz
/usr/bin/make install -- OK
RCAPUTO/Acme-POE-Tree-1.022.tar.gz
Has already been unwrapped into directory /home/vivek/.cpan/build/Acme-POE-Tree-1.022-uhlZUz
RCAPUTO/Acme-POE-Tree-1.022.tar.gz
Has already been prepared
Runningmakefor R/RC/RCAPUTO/Acme-POE-Tree-1.022.tar.gz
cp lib/Acme/POE/Tree.pm blib/lib/Acme/POE/Tree.pm
Manifying1 pod document
RCAPUTO/Acme-POE-Tree-1.022.tar.gz
/usr/bin/make-- OK
Runningmaketest
PERL_DL_NONLAZY=1"/usr/bin/perl""-MExtUtils::Command::MM""-MTest::Harness""-e""undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_basic.t .. ok
All tests successful.
Files=1, Tests=2, 6 wallclock secs ( 0.09 usr 0.03 sys + 0.53 cusr 0.06 csys = 0.71 CPU)
Result: PASS
RCAPUTO/Acme-POE-Tree-1.022.tar.gz
Tests succeeded but one dependency not OK (Curses)
RCAPUTO/Acme-POE-Tree-1.022.tar.gz
[dependencies] -- NA
Display the Christmas tree in Shell
Run the following command on the terminal:
perl -MAcme::POE::Tree-e 'Acme::POE::Tree->new()->run()'
Sample output
Gif 01: An animated christmas tree in Perl
Gif 01: A Festive christmas tree written in Perl
Tree Customization
The contents of tree. pl in my script file are as follows:
#!/usr/bin/perl
useAcme::POE::Tree;
my $tree =Acme::POE::Tree->new(
{
star_delay =>1.5,# shimmer star every 1.5 sec
light_delay =>2,# twinkle lights every 2 sec
run_for =>10,# automatically exit after 10 sec
}
);
$tree->run();
In this way, you can modify the starDelay, runThe value of the for and light_delay parameters comes from defining your tree. A fun terminal Christmas tree was born.
Via: http://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/
Author: Vivek Gite Translator: soooogreen Proofreader: wxy
This article was originally compiled by LCTT and launched with the honor of Linux in China
This article permanently updates the link address: