Introduction
YAD - (Yet Another Dialog) is a simple tool for developing Graphical User Interfaces. It will integrate with bash.
Type yad --help-all
in a terminal to see all command line help.
Unfortunately this help does not provide enough information on how to use yad to it’s full potential.
This is why i wrote this guide.
Most of the information is gathered from YAD help and YAD man page and some examples i have found on internet.
The guide is splited in several pages so it should be easier to find what you are looking for.
If examples used in this guide is from other sources it will be given at the examples.
All screenshots is made by me on Salix OS 15.0 with Qogir icon theme and Salix Gtk3 theme. The Qogir icon theme has its own yad icon and thats why my screenshots don’t have the default YAD icon.
All examples are tested with YAD 12.3 on Salix OS 15.0, However, I have not tested all available options.
I hope you find it usefull.
Cheers
Ingemar
What is YAD
YAD is a program that will display GTK+ dialogs, and return (either in the return code or on standard output) the users input. This allows you to present information, and ask for information from the user, from all manner of shell scripts.
1. About Dialog
You can create your own about dialog with YAD. Read more about About Dialog here.
2. App Dialog
Display application selection dialog
3. Calendar Dialog
4. Color Dialog
5. Drag & Drop Dialog
Display a drag-n-drop box.
6. Entry Dialog
Display text entry or combo-box dialog.
7. File Dialog
Display file selection dialog.
8. Font Dialog
9. Form Dialog
Display form dialog.
With form you can create advanced program.
10. HTML Dialog
11. Icons Dialog
12. List dialog
13. Notebook Dialog
Display notebook dialog.
With the combination of forms and notebook it is possible to create realy advanced program. Read more about Notebook Dialog here
14. Notification
15. Paned Dialog
16. Picture Dialog
17. Print Dialog
18. Progress Dialog
Display progress indication dialog.
19. Multi Progress dialog
The --multi-progress
options seems to be deprecated, instead use --progress
see the Multi progress bars section.
20. Scale Dialog
21. Text Dialog
22. Common Options
23. General options
This program follows the usual GNU command line syntax, with long options starting with two dashes ('--'
).
24. Miscellaneous options
25. Settings
26. Development
27. Environment Variables
YAD_OPTIONS
This variable can holds some default options for yad. All options in this variable may be redefined from command line.
YAD_PID
This variable sets to the value of current dialog’s pid and accessible in all dialog children.
YAD_XID
This variable sets to the value of current dialog’s X Window ID and accessible in all dialog children. This variable is not set in print and notification dialogs, and in a dialogs which acts as a notebook or paned children.
28. User Defined Signals
SIGUSR1
Close dialog with 0 exit code.
SIGUSR2
Close dialog with 1 exit code.
29. Exit Status
Exit codes for user-specified buttons must be specified in command line. Even exit code mean to print result, odd just return exit code.
CODE | Description |
---|---|
0 |
The user has pressed OK button |
1 |
The user has pressed Cancel button |
70 |
The dialog has been closed because the timeout has been reached. |
252 |
The dialog has been closed by pressing Esc or used the window functions to close the dialog |
30. Stock Items
This is a list of predefined items available in yad.
ID | Label text | Icon name |
---|---|---|
yad-about |
About |
help-about |
yad-add |
Add |
list-add |
yad-apply |
Apply |
gtk-apply |
yad-cancel |
Cancel |
gtk-cancel |
yad-clear |
Clear |
document-clear |
yad-close |
Close |
window-close |
yad-edit |
Edit |
gtk-edit |
yad-execute |
Execute |
system-run |
yad-no |
No |
gtk-no |
yad-ok |
OK |
gtk-ok |
yad-open |
Open |
document-open |
yad-print |
document-print |
|
yad-quit |
Quit |
application-exit |
yad-refresh |
Refresh |
view-refresh |
yad-remove |
Remove |
list-remove |
yad-save |
Save |
document-save |
yad-search |
Search |
system-search |
yad-settings |
Settings |
gtk-preferences |
yad-yes |
Yes |
gtk-yes |
31. Examples
Here i have collected some Examples that might be usefull.