Home » Linux » Creating graphics and presentations on the Linux CLI

Creating graphics and presentations on the Linux CLI

Last updated Oct 4, 2021

In this article, we are going to learn how to make presentations and how to create graphics on the CLI. For this, we are going to use a tool named dialog.dialog is a Linux command-line tool used for taking input from users and to create message boxes.

Prerequisites

Besides having a terminal open, make sure you have the dialog utility installed on your system. Install it by using the apt command. APT stands for Advanced Package Tool. Using the apt command, you can manage software from the command line for debian-based Linux. The apt command easily interacts with the dpkg packaging system.

How to do it

We are going to write a script for a Yes/No box. In that script, we are going to use the if condition. Create the yes_no.sh script and add the following content to it:

dialog --yesno "Do you wish to continue?" 0 0 
a=$? 
if [ "${a}" == "0" ]; then 
	echo Yes 
else 
	echo No 
fi

We’ll use dialog’s calendar. Create a calendar_dialog.sh script. In that, we’ll select a specific date:

dialog --calendar "Select a date... " 0 0 1 1 2018 
val=$?

We’re going to use the checklist option of dialog. Create a checklist_dialog.sh script. In that, we’ll select multiple options:

dialog --stdout --checklist "Enable the account options you want:" 10 40 3 \ 
	1 "Home directory" on \ 
	2 "Signature file" off \ 
	3 "Simple password" off

Now, we are going to write a script to raise the border of an image. Create a raise_border.sh script. We’ll use the convert command with the raise option:

convert -raise 5x5 mountain.png mountain-raised.png

How it works

Now we will see a description of the options and commands written in the preceding scripts:

  • We wrote code for a Yes/No box using the dialog tool in Linux. We used the if condition to take an answer of either Yes or No.
  • We used the --calendar option of the dialog tool. It asks for a date to be selected. We selected a date from the year 2018.
  • We used the checklist option of the dialog tool. We made a checklist, which had three options: Home directory, Signature file, and Simple Password.
  • We raised the border of an image using the convert command and the –raise option, and then the new image was saved as mountain-raised.png.

Related Posts

Creating a lame utility HTTP server in Linux Operating System

In this article, we will discuss the cURL tool in Linux. The cURL tool is used for transferring the data from or to a server. It supports many protocols, and http is one of them. cURL is used to transfer the data from URL. It has so many tricks to offer, such as http...

Finding binary dependencies in Linux Operating System

In this article, we are going to check the executable. We will find out which string is present in it by using the string command.PrerequisitesBesides having a terminal open, make sure you have a binary present in your directory.Find dependencies First, we...

Capturing network traffic headlessly in Linux Operating System

In this article, we are going to learn how to capture traffic. We are going to capture network traffic with a packet sniffer tool called tcpdump. This tool is used to filter or capture TCP/IP packets that are transferred or received over a network.PrerequisitesBesides...

Follow Us

Our Communities

More on Linux

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

17 + 10 =

Shares