What is Zenity, Espeak-ng and Date keywords in Linux also get to know some playful commands.

Sachin Joshi
7 min readSep 24, 2021

What is Zenity?

Zenity enables you to create the various types of simple dialog. Zenity is a rewrite of gdialog, the GNOME port of dialog which allows you to display GTK+ dialog boxes from the command line and shell scripts.

You can use Zenity to create simple dialogs that interact graphically with the user from the command prompt. Zenity is also available for macOS and Windows.

Few features of Zenity are as follows:-
* Basic forms
* Calendar dialogs
* Color selection dialogs
* List Dialog
* Message and Notification Dialog
* Progress bars and Scales
* Text Entry and Text Information Dialogs

Installation of Zenity in Linux:-

Zentity is by default installed or available in repository of most of the Standard Linux distribution present. To check if Zenity is installed onto your machine or Vm machine run following command.

zenity --version

If it’s not installed, you can install it using Yum command

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

To know what is EPEL and how to use it, take a look at the following blog.

Some Zenity Basic Dialog Boxes

  1. An error Dialog Box
zenity --error

2. Calendar Dialog Box

zenity --calendar

3. Information Dialog Box

zenity --info

4. General Text Entry Dialog Box

zenity --entry

5. Question Dialog Box

zenity --question

6. A Password Dialog

zenity --password

7. Progress Bar Dialog

zenity --progress

8.Customizing Dialog

create the variable “first”

  1. –entry‘ means zenity is asked to generate an text Entry box.
  2. – title=‘ defines the title of generated text box.
  3. — text=‘ defines the text that is available on text Entry box
first=$(zenity --title="Your's first name" --text"What is your first name?" --entry)

now to use that variable with different Zenity function.

zenity --info --title="Welcome Back" --text= Mr./Ms. $first"

Also you can always use manual or help option

man zenity

To know more about Zenity visit below:

What is Espeak-ng?

The espeak-ng command Linux is good for beginners to learn and grasp its concept and can apply to his/her projects. It uses in RHEL 7 and 8th version of Linux. We will cover most of the commands through video demonstration the reason will be known in the minute.

To Speak a sentence in English(by default) Voice

espeak-ng "Sachin"

To make system speak in different language

This will speak in African Voice

espeak-ng -v af "This is Sachin"

By default, system would speak out in male voice. To make it female use the following command

espeak-ng -v en+f2 "This is Sachin"

To set pitch

Default is 50 units

espeak-ng -v en+f2 -p 65 "This is Sachin"

To set speed in words per minute

Default is 160.

espeak-ng -v en+f2 -s 120 "This is Sachin"

To set word gap

Word gap. Pause between words, units of 10ms at the default speed.

espeak-ng -v en+f2 -g 18 "This is Sachin"

Playful Commands in Linux.

Do you want a steam locomotive train in your termial?

root@localhost:~# yum install sl
root@localhost:~# sl

Does your cow speak? Well my cow, does. Let me show you how..

root@localhost:~# yum install cowsay 
root@localhost:~# cowsay

Well, my dragon speaks too , though its funny.

root@localhost:~# cowsay -f dragon Linuxworld

Have you ever wondered, what if I could know about my fortune or quotes every day? Well, we can

root@localhost:~# yum install fortune 
root@localhost:~# fortune

Now ,let our cow speak our fortune

root@localhost:~# fortune | cowsay

Ghosts can speak too, only in Linux though

root@localhost:~# cowsay -f ghostbusters Hey bro
  1. Cowsay

cowsay is a program that generates ASCII art pictures of a cow with a message. It can also generate pictures using pre-made images of other animals, such as Tux the Penguin, the Linux mascot

2. Cowthink

The cow can do more than just talking, it can even think. To make the cow think, use the cowthink command.

3. figlet — draw banners

The figlet command can be used to draw large sized text banners. I remember seeing such banners as the welcome message of socket daemons/services, when connecting via telnet

4. toilet — draw banners again

The toilet command is similar to the figlet command, that it draws large sized text banners using smaller characters.

5. banner

The banner command too can print banners like figlet and toilet but it is very limited. No options and can print only 10 characters at most.

6. cmatrix — The MATRIX

The command cmatrix draws the Neo style matrix on your terminal and makes you feel a little more geekier.

Date Command in Linux

Date command is used to display the system date and time. date command is also used to set date and time of the system. By default the date command displays the date in the time zone on which unix/linux operating system is configured.You must be the super-user (root) to change the date and time.

Custom Formatting :

Date arithmetic

Display the time described by the user friendly string.

Date String :

The -s option allows you to operate on a specific date. You can specify the date as a human-readable date string.

Date Formatting :

The output of date can be formatted with a format string that is preceeded by a + sign.

Using date with Other Commands :

Timeout

Print the date, run sleep for 10 seconds but with a timeout of 1 second and than run date again :

Common formats :

ISO 8601 format

-I or — iso-8601 prints the date in ISO 8601 format.

RFC 3339 format

Similarly, — rfc-3339=x prints a date in RFC 3339 format, x being date, sec or ns.

Email format

Then, there is also the so called email format.

You can Connect me here:

— — -If you liked this article, please drop a clap so it can reach more people — -

--

--