I've got a zenity form working, but I can't find any information on initializing the entries. The Zenity help manual webpage doesn't address the issue. For example, the example from that webpage is
#!/bin/sh
zenity --forms --title="Add Friend" \
--text="Enter information about your friend." \
--separator="," \
--add-entry="First Name" \
--add-entry="Family Name" \
--add-entry="Email" \
--add-calendar="Birthday" >> addr.csv
case $? in
0)
echo "Friend added.";;
1)
echo "No friend added."
;;
-1)
echo "An unexpected error has occurred."
;;
esac
How would I initialize First Name, Last Name, etc. before displaying the window?
Use yad. It's a fork of zenity that I ended up using to overcome this missing functionality in zenity. The key is to use the --form option and include the initial values on the command line after the defined options and parameters. This "extra data" is assumed to be initial values for the fields.
initial_name_data='Jane Doe'; initial_email_data='[email protected]'
yad --form --title='Contact Info' --text='Edit Data' --field=Name --field=Email "$initial_name_data" "$initial_email_data"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With