Zenity is a powerful command-line utility that allows users to create graphical user interfaces (GUIs) for shell scripts and terminal commands. In this blog post, we'll delve into the various options and functionalities offered by Zenity, accompanied by output screenshots for better understanding.
Zenity is a handy tool for enhancing the user experience of shell scripts by providing graphical dialogs such as message boxes, input forms, file selection dialogs, progress bars, and more. It simplifies interaction with users and adds a visual element to terminal-based applications.
Here i use Amazon Cloud ubuntu AMI & I used putty for ssh connection.(private-key amazon -->> .ppk )
- On putty:
-
In Session -->> Hostname: ubuntu@public_ip_of_instance -->> select ssh
-
SSH -->> Auth -->> Credentials -->> private key file for Auth (same key of used for instance)
-
SSH -->> Auth -->> X11 -->> Enable X11 forwarding
- Note:
X11 server need on local window for allow display ,
If don't have then download "Xming" link for download- Xming-Download-link After download install and open onces, it can't open just click on open.
- Note:
Also check SSH settings of instance , "/etc/ssh/sshd_config" in this folder allow "X11Forwarding yes". After that just restart sshd by using "systemctl restart sshd" command.
Installation:
1st need to update use follow command:
sudo apt-get update
Install command for zenity on ubuntu:
sudo apt-get install zenity
Check zenity install or not:
zenity --version
zenity --info --text="Hello, World!"
zenity --warning --text="This is a warning message."
zenity --error --text="An error occurred."
zenity --question --text="Do you want to continue?"
zenity --entry --text="Enter your name:"
zenity --password --text="Enter your password:"
zenity --file-selection --title="Select a file:"
zenity --calendar --title="Select a date:"
zenity --progress --title="Progress" --text="Processing..." --percentage=50
zenity --color-selection --title="Select a color:"
zenity --question --text="Do you want to save your changes?" --ok-label="Yes" --cancel-label="No"
(sleep 20; echo "100") | zenity --progress --auto-close --text="Processing..."
here need 1st install fortune-mod on instance.
sudo apt install fortune-mod