{"id":12437,"date":"2019-03-27T01:03:49","date_gmt":"2019-03-27T01:03:49","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12437"},"modified":"2019-03-27T01:03:49","modified_gmt":"2019-03-27T01:03:49","slug":"zenity-creates-graphical-gtk-dialog-boxes-in-command-line-and-shell-scripts","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/27\/zenity-creates-graphical-gtk-dialog-boxes-in-command-line-and-shell-scripts\/","title":{"rendered":"Zenity \u2013 Creates Graphical (GTK+) Dialog Boxes in Command-line and Shell Scripts"},"content":{"rendered":"<p><strong>GNU Linux<\/strong>, the operating system built on very powerful\u00a0<strong>Kernel<\/strong>\u00a0called\u00a0<strong>Linux<\/strong>. Linux is famous for its command Line operations. With the invent of Linux in day-to-day and Desktop computing, nix remains no more biased towards command-Line, it is equally Graphical and developing Graphical application remains no more a difficult task.<\/p>\n<div id=\"attachment_5515\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Zenity.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5515\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Zenity-620x445.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Zenity-620x445.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Zenity.jpeg 651w\" alt=\"Install Zenity in Linux\" width=\"620\" height=\"445\" aria-describedby=\"caption-attachment-5515\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5515\" class=\"wp-caption-text\">Zenity Display Graphical Boxes<\/p>\n<\/div>\n<p>Here in this article we will be discussing creation and execution of simple Graphical Dialog box using\u00a0<strong>GTK+<\/strong>application called \u201c<strong>Zenity<\/strong>\u201c.<\/p>\n<h3>What is Zenity?<\/h3>\n<p><strong>Zenity<\/strong>\u00a0is an open source and a cross-platform application which displays\u00a0<strong>GTK+ Dialog Boxes<\/strong>\u00a0in command-line and using shell scripts. It allows to ask and present information to\/from shell in Graphical Boxes. The application lets you create Graphical dialog boxes in command-line and makes the interaction between user and shell very easy.<\/p>\n<p>There are other alternatives<strong>,<\/strong>\u00a0but nothing compares to the simplicity of\u00a0<strong>Zenity<\/strong>, specially when you don\u2019t need complex programming. Zenity, a tool you must have your hands on.<\/p>\n<h4>Zenity Features<\/h4>\n<ol>\n<li>FOSS Software<\/li>\n<li>Cross Platform Application<\/li>\n<li>Allow GTK+ Dialog Box Execution<\/li>\n<li>Command Line Tool<\/li>\n<li>Support in Shell Scripting<\/li>\n<\/ol>\n<h4>Usefulness<\/h4>\n<ol>\n<li>Easy GUI Creation<\/li>\n<li>Less features than other complex Tools<\/li>\n<li>Enables shell scripts to interact with a GUI users<\/li>\n<li>Simple dialog creation is possible for graphical user interaction<\/li>\n<\/ol>\n<p>Since\u00a0<strong>Zenity<\/strong>\u00a0is available for all known major platforms, and based on GTK+ library, Zenity program can be ported to\/from another platform.<\/p>\n<h3>Installation of Zenity in Linux<\/h3>\n<p><strong>Zentity<\/strong>\u00a0is by default installed or available in repository of most of the Standard Linux distribution of today. You can check if is installed onto your machine or not by executing following commands.<\/p>\n<pre>ravisaive@tecmint:~$ zenity --version \r\n\r\n<strong>3.8.0<\/strong><\/pre>\n<pre>ravisaive@tecmint:~$ whereis zenity \r\n\r\n<strong>zenity: \/usr\/bin\/zenity \/usr\/bin\/X11\/zenity \/usr\/share\/zenity \/usr\/share\/man\/man1\/zenity.1.gz<\/strong><\/pre>\n<p>If it\u2019s not installed, you can install it using\u00a0<strong>Apt<\/strong>\u00a0or\u00a0<strong>Yum<\/strong>\u00a0command as shown below.<\/p>\n<pre>ravisaive@tecmint:~$ sudo apt-get install zenity\t\t[on <strong>Debian<\/strong> based systems]\r\n\r\nroot@tecmint:~# yum install zenity\t\t\t\t[on <strong>RedHat<\/strong> based systems]<\/pre>\n<p>Moreover you can also build it from the source files, download the latest\u00a0<strong>Zenity<\/strong>\u00a0source package (i.e.\u00a0<strong>current version 3.8<\/strong>) using a following link.<\/p>\n<ol>\n<li><a href=\"http:\/\/ftp.gnome.org\/pub\/gnome\/sources\/zenity\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/ftp.gnome.org\/pub\/gnome\/sources\/zenity\/<\/a><\/li>\n<\/ol>\n<h3>Zenity Basic Dialog Boxes<\/h3>\n<p>Some of the basic Dialogs of\u00a0<strong>Zenity<\/strong>, which can be invoked directly from the command-line.<\/p>\n<h6>1. How about a quick calendar dialog?<\/h6>\n<pre>root@tecmint:~# zenity --calendar<\/pre>\n<div id=\"attachment_5500\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Calandar.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5500\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Calandar-620x353.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Calandar-620x353.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Calandar-1024x584.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Calandar.jpeg 1193w\" alt=\"Calendar Dialogue\" width=\"620\" height=\"353\" aria-describedby=\"caption-attachment-5500\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5500\" class=\"wp-caption-text\">Calendar Dialog<\/p>\n<\/div>\n<h6>2. An error Dialog Box<\/h6>\n<pre>root@tecmint:~# zenity --error<\/pre>\n<div id=\"attachment_5502\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Error.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5502\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Error-620x360.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Error-620x360.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Error.jpeg 1015w\" alt=\"Error Dialogue\" width=\"620\" height=\"360\" aria-describedby=\"caption-attachment-5502\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5502\" class=\"wp-caption-text\">Error Dialog<\/p>\n<\/div>\n<h6>3. A General text Entry Dialog Box<\/h6>\n<pre>root@tecmint:~# zenity --entry<\/pre>\n<div id=\"attachment_5503\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Entry.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5503\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Entry-620x388.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Entry-620x388.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Entry.jpeg 925w\" alt=\"Entry Dialogue\" width=\"620\" height=\"388\" aria-describedby=\"caption-attachment-5503\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5503\" class=\"wp-caption-text\">Entry Dialog<\/p>\n<\/div>\n<h6>4. An Information Dialog<\/h6>\n<pre>root@tecmint:~# zenity --info<\/pre>\n<div id=\"attachment_5504\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Info.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5504\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Info-620x368.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Info-620x368.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Info.jpeg 985w\" alt=\"Info Dialogue\" width=\"620\" height=\"368\" aria-describedby=\"caption-attachment-5504\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5504\" class=\"wp-caption-text\">Info Dialog<\/p>\n<\/div>\n<h6>5. A question Dialog box<\/h6>\n<pre>root@tecmint:~# zenity --question<\/pre>\n<div id=\"attachment_5505\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Question.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5505\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Question-620x366.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Question-620x366.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Question-1024x604.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Question.jpeg 1038w\" alt=\"Question Box\" width=\"620\" height=\"366\" aria-describedby=\"caption-attachment-5505\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5505\" class=\"wp-caption-text\">Question Box<\/p>\n<\/div>\n<h6>6. A progress Bar<\/h6>\n<pre>root@tecmint:~# zenity --progress<\/pre>\n<div id=\"attachment_5506\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Progress.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5506\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Progress-620x374.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Progress-620x374.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Progress.jpeg 976w\" alt=\"Progress Bar\" width=\"620\" height=\"374\" aria-describedby=\"caption-attachment-5506\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5506\" class=\"wp-caption-text\">Progress Bar<\/p>\n<\/div>\n<h6>7. Scale Dialog<\/h6>\n<pre>root@tecmint:~# zenity --scale<\/pre>\n<div id=\"attachment_5507\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Scale.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5507\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Scale-620x363.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Scale-620x363.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Scale-1024x600.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Scale.jpeg 1059w\" alt=\"Scale Box\" width=\"620\" height=\"363\" aria-describedby=\"caption-attachment-5507\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5507\" class=\"wp-caption-text\">Scale Box<\/p>\n<\/div>\n<h6>8. A Password Dialog<\/h6>\n<pre>root@tecmint:~# zenity --password<\/pre>\n<div id=\"attachment_5508\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Password.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5508\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Password-620x365.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Password-620x365.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Password-1024x603.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Password.jpeg 1043w\" alt=\"Password Box\" width=\"620\" height=\"365\" aria-describedby=\"caption-attachment-5508\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5508\" class=\"wp-caption-text\">Password Box<\/p>\n<\/div>\n<h6>9. A Form Dialog box<\/h6>\n<pre>root@tecmint:~# zenity --forms<\/pre>\n<div id=\"attachment_5509\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Forms.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5509\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Forms-620x344.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Forms-620x344.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Forms-1024x569.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Forms.jpeg 1160w\" alt=\"Forms\" width=\"620\" height=\"344\" aria-describedby=\"caption-attachment-5509\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5509\" class=\"wp-caption-text\">Forms<\/p>\n<\/div>\n<h6>10. An about Dialog<\/h6>\n<pre>root@tecmint:~# zenity --about<\/pre>\n<div id=\"attachment_5510\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/About.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5510\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/About-620x335.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/About-620x335.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/About-1024x553.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/About.jpeg 1173w\" alt=\"About Zenity\" width=\"620\" height=\"335\" aria-describedby=\"caption-attachment-5510\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5510\" class=\"wp-caption-text\">About Zenity<\/p>\n<\/div>\n<h3>Create Shell Script Dialog<\/h3>\n<p>Now we would be discussing\u00a0<strong>Zenity Dialog<\/strong>\u00a0creation using\u00a0<a target=\"_blank\">simple shell scripts<\/a>\u00a0here. Although we can create single Dialog by executing\u00a0<strong>Zenity<\/strong>\u00a0commands directly from the shell (as we did above) but then we can\u2019t link two Dialog boxes in order to obtain some meaningful result.<\/p>\n<p>How about an interactive dialog box which takes input from you, and shows the result.<\/p>\n<pre>#!\/bin\/bash \r\nfirst=$(zenity --title=\"Your's First Name\" --text \"What is your first name?\" --entry) \r\nzenity --info --title=\"Welcome\" --text=\"Mr.\/Ms. $first\" \r\nlast=$(zenity --title=\"Your's Last Name\" --text \"$first what is your last name?\" --entry) \r\nzenity --info --title=\"Nice Meeting You\" --text=\"Mr.\/Ms. $first $last\"<\/pre>\n<p>Save it to \u2018<strong>anything.sh<\/strong>\u2018 (conventionally) and do not forget to make it executable. Set\u00a0<strong>755<\/strong>\u00a0permission on\u00a0<strong>anything.sh<\/strong>\u00a0file and run the script.<\/p>\n<pre>root@tecmint:~# chmod 755 anything.sh \r\nroot@tecmint:~# sh anything.sh<\/pre>\n<div id=\"attachment_5511\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-1.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5511\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-1-620x363.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-1-620x363.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-1-1024x599.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-1.jpeg 1135w\" alt=\"Enter Your First Name\" width=\"620\" height=\"363\" aria-describedby=\"caption-attachment-5511\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5511\" class=\"wp-caption-text\">Enter Your First Name<\/p>\n<\/div>\n<div id=\"attachment_5512\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-2.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5512\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-2-620x372.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-2-620x372.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-2-1024x614.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-2.jpeg 1100w\" alt=\"Welcome Dialogue\" width=\"620\" height=\"372\" aria-describedby=\"caption-attachment-5512\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5512\" class=\"wp-caption-text\">Welcome Dialog<\/p>\n<\/div>\n<div id=\"attachment_5513\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-3.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5513\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-3-620x366.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-3-620x366.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-3-1024x605.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-3.jpeg 1169w\" alt=\"Enter Your Last Name\" width=\"620\" height=\"366\" aria-describedby=\"caption-attachment-5513\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5513\" class=\"wp-caption-text\">Enter Your Last Name<\/p>\n<\/div>\n<div id=\"attachment_5514\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-4.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5514\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-4-620x373.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-4-620x373.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-4-1024x616.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/02\/Script-Dialogue-4.jpeg 1152w\" alt=\"Welcome Message\" width=\"620\" height=\"373\" aria-describedby=\"caption-attachment-5514\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5514\" class=\"wp-caption-text\">Welcome Message<\/p>\n<\/div>\n<h4>About Script Description<\/h4>\n<p>The conventional shebang aka hashbang<\/p>\n<pre>#!\/bin\/bash<\/pre>\n<p>In the below line \u2018first\u2019 is a variable and the value of variable is Generated at run time.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>\u2018<strong>\u2013entry<\/strong>\u2018 means zenity is asked to generate an text Entry box.<\/li>\n<li>\u2018<strong>\u2013 title=<\/strong>\u2018 defines the title of generated text box.<\/li>\n<li>\u2018<strong>\u2014text=<\/strong>\u2018 defines the text that is available on text Entry box.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre>first=$(zenity --title=\"Your's First Name\" --text \"What is your first name?\" --entry)<\/pre>\n<p>This line of the below script file is for generation of Information (\u2013info) Dialog box, with title \u201cWelcome\u201d and Text \u201cMr.\/Ms.first\u201d<\/p>\n<pre>zenity --info --title=\"Welcome\" --text=\"Mr.\/Ms. $first\"<\/pre>\n<p>This Line of the script is Similar to line number two of the script except here a new variable \u2018last\u2019 is defined.<\/p>\n<pre>last=$(zenity --title=\"Your's Last Name\" --text \"$first what is your last name?\" --entry)<\/pre>\n<p>This last line of the script is again similar to the third line of the script and it generates information Dialog box which contains both the variables \u2018$first\u2019 and \u2018$last\u2019.<\/p>\n<pre>zenity --info --title=\"Nice Meeting You\" --text=\"Mr.\/Ms. $first $last\"<\/pre>\n<p>For more information on how to create custom dialog boxes using shell script, visit at following reference page\u00a0<strong>Zenity<\/strong>.<\/p>\n<ol>\n<li><a href=\"https:\/\/help.gnome.org\/users\/zenity\/stable\/\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/help.gnome.org\/users\/zenity\/stable\/<\/a><\/li>\n<\/ol>\n<p>In the next article we would be integrating\u00a0<strong>Zenity<\/strong>\u00a0with more shell script for\u00a0<strong>GUI<\/strong>\u00a0user interaction. Till then stay tuned and connected to\u00a0<strong>Tecmint<\/strong>. Don\u2019t forget to give your valuable feedback in comment section.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/zenity-creates-graphical-gtk-dialog-boxes-in-command-line-and-shell-scripts\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GNU Linux, the operating system built on very powerful\u00a0Kernel\u00a0called\u00a0Linux. Linux is famous for its command Line operations. With the invent of Linux in day-to-day and Desktop computing, nix remains no more biased towards command-Line, it is equally Graphical and developing Graphical application remains no more a difficult task. Zenity Display Graphical Boxes Here in this &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/27\/zenity-creates-graphical-gtk-dialog-boxes-in-command-line-and-shell-scripts\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Zenity \u2013 Creates Graphical (GTK+) Dialog Boxes in Command-line and Shell Scripts&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12437","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12437"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12437\/revisions"}],"predecessor-version":[{"id":12438,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12437\/revisions\/12438"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}