Merry Christmas and a new year full of success in Linux!

botond published March 2020, 12, Thu - 24:15 time

I would like to wish you a Merry Christmas and a Happy New Year rich in Linux to everyone!

 

If you want to create a Christmas atmosphere on our terminal, I would love to recommend it from GitHub Sergio Lepore's Christmas tree script!

To use it, all you have to do is run the following command:

curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash

Then we get an animated Christmas tree with greetings:

Shell Christmas tree

A CTRL + C keys to exit it.

 

Another Christmas tree script is also worth trying, which original version can be found here. In it, I rewrote my own welcome text.

Create a file:

nano karacsonyfa.sh

And let’s include the following content with our own message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# The following line tells the shell what program to interpret the script with
#!/bin/bash
 
# tput is a command to manipulate the terminal, it can be used to change the color of text, apply effects, and generally brighten things up.
trap "tput reset; tput cnorm; exit" 2
clear
tput civis
lin=2
col=$(($(tput cols) / 2))
c=$((col-1))
est=$((c-2))
color=0
 
# Set the text color to green to write the tree
tput setaf 2; tput bold
 
# Write the tree
for ((i=1; i<40; i+=2))
{
    tput cup $lin $col
    for ((j=1; j<=i; j++))
    {
        echo -n \*
    }
    let lin++
    let col--
}
 
## Set the color to brown for the trunk
tput sgr0; tput setaf 130
 
# Write the Trunk in three lines
for ((i=1; i<=3; i++))
{
    tput cup $((lin++)) $c
    echo 'mWm'
}
 
# Write a greeting
tput setaf 93; tput bold
tput cup $lin $((c - 15)); echo Kellemes karácsonyi ünnepeket és
tput cup $((lin + 1)) $((c - 16)); echo boldog új évet kíván a Linuxportál!
let c++
k=1
 
# Configure lights and decorations
while true; do
    for ((i=1; i<=35; i++)) {
        # Turn off the lights
        [ $k -gt 1 ] && {
            tput setaf 2; tput bold
            tput cup ${line[$[k-1]$i]} ${column[$[k-1]$i]}; echo \*
            unset line[$[k-1]$i]; unset column[$[k-1]$i]  # Array cleanup
        }
 
        li=$((RANDOM % 9 + 10))
        start=$((c-li+2))
        co=$((RANDOM % (li-2) * 2 + 1 + start))
        tput setaf $color; tput bold   # Switch colors
        tput cup $li $co
        echo o
        line[$k$i]=$li
        column[$k$i]=$co
        color=$(((color+1)%8))
    }
    k=$((k % 2 + 1))
done

Then give the file run permission and run:

chmod +x karacsonyfa.sh
./ karacsonyfa.sh

Shell Christmas tree 2.

From this also the CTRL + C keys to exit.

After rewriting your own welcome text in it, adjust the positions of the lines in the formulas before the echo commands so that the caption is centered.