Science and technology

Plan your personal vacation calendar on the Linux command line

Welcome to right this moment’s installment of the Linux command-line toys creation calendar. If that is your first go to to the sequence, you is perhaps asking your self, what’s a command-line toy. Even I am not fairly certain, however usually, it may very well be a recreation or any easy diversion that helps you may have enjoyable on the terminal.

It’s fairly attainable that a few of you should have seen numerous picks from our calendar earlier than, however we hope there’s a minimum of one new factor for everybody.

We’ve by some means made it to the seventh day of our sequence with out creating an precise calendar to have a good time with, so let’s use a command-line software to do this right this moment: cal. By itself, cal is probably not probably the most wonderful of instruments, however we will use a number of different utilities to spice it up a bit.

Chances are, cal is put in in your system already. To use it on this occasion, simply kind cal.

$ cal
    December 2018  
Su Mo Tu We Th Fr Sa
                   1
 2  three  four  5  6  7  eight
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

We aren’t going to enter superior utilization on this article, so if you wish to study extra about cal, go take a look at Opensource.com Community Moderator Don Watkin’s wonderful overview of the date and cal commands.

Now, let’s spice it up with a fairly field, as we lined in our earlier Linux toy article. I am going to use the diamonds field, and use a bit little bit of padding to get it properly aligned.

$ cal | bins -d diamonds -p a1l4t2 
       /          /          /
    ////    ////    ////
 ///////////////////
////////////////////
///                            ///
 /                                  /
 /           December 2018          /
//      Su Mo Tu We Th Fr Sa      //
//                         1      //
 /        2  three  four  5  6  7  eight       /
 /        9 10 11 12 13 14 15       /
//      16 17 18 19 20 21 22      //
//      23 24 25 26 27 28 29      //
 /       30 31                      /
 /                                  /
///                            ///
////////////////////
 ///////////////////
    ////    ////    ////
       /          /          /

That appears good, however for good measure, let’s put the entire thing in a second field, only for enjoyable. We’ll use the scoll design this time.

cal | bins -d diamonds -p a1t2l3 | bins -a c -d scroll        
 / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  /~~                                              /~~  |
|   |         /          /          /         |   / /|
|   /|      ////    ////    ////      |   / |
|  ~~  |   ///////////////////   |  ~~  |
|      |  ////////////////////  |      |
|      |  ///                            ///  |      |
|      |   /                                  /   |      |
|      |   /          December 2018           /   |      |
|      |  //     Su Mo Tu We Th Fr Sa       //  |      |
|      |  //                        1       //  |      |
|      |   /       2  three  four  5  6  7  eight        /   |      |
|      |   /       9 10 11 12 13 14 15        /   |      |
|      |  //     16 17 18 19 20 21 22       //  |      |
|      |  //     23 24 25 26 27 28 29       //  |      |
|      |   /      30 31                       /   |      |
|      |   /                                  /   |      |
|      |  ///                            ///  |      |
|      |  ////////////////////  |      |
|      |   ///////////////////   |      |
|      |      ////    ////    ////      |      |
|      |         /          /          /         |      |
|      |                                            |      |
      |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|     /
    /                                                 /
   ~~~                                                ~~~

Perfect. Now, here is the place issues get a bit loopy. I like our design, however, I would wish to go all out. So I will colorize it. But right here within the Raleigh, NC workplace the place Opensource.com’s employees are based mostly, there is a good likelihood for snow this weekend. So let’s take pleasure in our colorized creation calendar, after which wipe it out with snow.

For the snow, I am grabbing a nifty snippet of Bash and Gawk goodness I discovered over on CLIMagic. If you are not acquainted with CLIMagic, go take a look at their website and observe them on Twitter. You’ll be glad you probably did.

So right here we go. Let’s clear the display, throw up our boxy calendar, colorize it, wait a number of seconds, then snowstorm it away. All right here on the terminal, in a single line.

$ clear;cal|bins -d diamonds -p a1t2l3|bins -a c -d scroll|lolcat;sleep three;whereas :;do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS)) $(printf "u2744n");sleep zero.1;finished|gawk 'a[$3]=zero;for(x in a) '

And there we go.

For this to work in your system, you will want the entire references utilities (bins, lolcat, cal, gawk, and so on.), and you will want to make use of a terminal emulator that helps Unicode.

Do you may have a favourite command-line toy that you just suppose I should profile? The calendar for this sequence is generally crammed out however I’ve acquired a number of spots left. Let me know within the feedback beneath, and I am going to test it out. If there’s area, I am going to attempt to embrace it. If not, however I get some good submissions, I am going to do a round-up of honorable mentions on the finish.

Check out yesterday’s toy, Take a break at the Linux command line with Nyan Cat, and test again tomorrow for an additional!

Most Popular

To Top