YAD(1) | User Commands | YAD(1) |
NAME
yad - display GTK+ dialogs from shell scripts or command-line
SYNOPSIS
yad [OPTIONS]
DESCRIPTION
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.
YAD is the fork of Zenity program.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-').
Dialog options
- --about
- Display about dialog.
- --app
- Display application selection dialog.
- --calendar
- Display calendar dialog.
- --color
- Display color selection dialog.
- --dnd
- Display drag-and-drop box.
- --entry
- Display text entry dialog.
- --icons
- Display box with shortcut icons.
- --file
- Display file selection dialog.
- --font
- Display font selection dialog.
- --form
- Display form dialog
- --html
- Display HTML dialog
- --list
- Display list dialog
- --multi-progress
- Display multi progress bars dialog.
- --notebook
- Display notebook dialog.
- --notification
- Display notification icon.
- Display print dialog.
- --progress
- Display progress indication dialog.
- --text-info
- Display text information dialog.
- --scale
- Display scale dialog.
General options
- --title=TITLE
- Set the dialog title.
- --window-icon=ICON
- Set the window icon.
- --width=WIDTH
- Set the dialog window width.
- --height=HEIGHT
- Set the dialog window height.
- --posx=NUMBER
- Set the X position of dialog window. NUMBER can be negative.
- --posy=NUMBER
- Set the Y position of dialog window. NUMBER can be negative.
- --geometry=WIDTHxHEIGHT+X+Y
- Use standard X Window geometry notation for placing dialog. When this option is used, width, height, posx, posy, mouse and center options are ignored.
- --timeout=TIMEOUT
- Set the dialog timeout in seconds.
- --timeout-indicator=POSITION
- Show timeout indicator in given position. Positions are top, bottom, left or right. Style of indicator may be set through the users CSS styles.
- --kill-parent=[SIGNAL]
- Send SIGNAL to parent process. Default value of SIGNAL is a SIGTERM. SIGNAL may be specified by it's number or symbolic name with or without SIG prefix. See signal(7) for details about signals.
- --print-xid=[FILENAME]
- Output X Window ID of a yad's window to the specified file or stderr.
- --plug=KEY
- Run dialog in plug mode for swallow as a notebook tab. See NOTEBOOK section for more.
- --tabnum=NUMBER
- Set the tab number for plugged dialog. See NOTEBOOK section for more.
- --text=STRING
- Set the dialog text.
- --text-width=NUMBER
- Set the maximum dialog text width in characters.
- --text-align=TYPE
- Set type of dialog text justification. TYPE may be left, right, center or fill.
- --image=IMAGE
- Set the dialog image which appears on the left side of dialog`s text. IMAGE might be file name or icon name from current icon theme.
- --icon-theme=THEME
- Use specified GTK icon theme instead of default.
- --keep-icon-size
- Don't scale icons. This option affects icons outside icon theme.
- --expander=[TEXT]
- Hide main widget with expander. TEXT is an optional argument with expander's label.
- Add the dialog button. May be used multiple times. ID is an exit code or a command. BUTTON may be a yad stock item name for predefined buttons (like yad-close or yad-ok) or text in a form LABEL[!ICON[!TOOLTIP]] where `!' is an item separator. Full list of stock items may be found in section STOCK ITEMS. If no buttons specified OK and Cancel buttons used. See EXIT STATUS section for more. If ID have a non-numeric value it treats as a command and click on such button doesn't close the dialog.
- Don't show buttons.
- Set buttons layout type. Possible types are: spread, edge, start, end or center. Default is end.
- --no-markup
- Don't use pango markup in dialog's text.
- --no-escape
- Don't close dialog if Escape was pressed.
- --escape-ok
- Escape acts like pressing OK button.
- --always-print-result
- Print result for any of the return codes. This option doesn't work if timeout was reached or Escape was pressed.
- --use-interp=[INTERP]
- All commands runs under specified interpreter. Default is bash -c "%s". This option can reduse quoting in commands. If %s is specified, it will be replaced by the command. Otherwise command will be appended to the end of command line.
- --uri-handler=CMD
- Use CMD as uri handler. By default yad uses open-command parameter from settings. URI replace %s in command string or adds as a last part of command line.
- --f1-action=CMD
- Set the command running when F1 was pressed.
- --workdir=PATH
- Set current working directory to PATH.
- --borders=NUM
- Set dialog window borders.
- --sticky
- Make window visible on all desktops.
- --fixed
- Make window fixed width and height.
- --center
- Place window on center of screen.
- --mouse
- Place window under mouse position.
- --on-top
- Place window over other windows.
- --undecorated
- Make window undecorated (remove title and window borders).
- --skip-taskbar
- Don't show window in taskbar and pager.
- --maximized
- Run dialog window maximized.
- --fullscreen
- Run dialog in fullscreen mode. This option may not work on all window managers.
- --splash (Deprecated)
- Open window with "splashscreen" window hints. For details see
description of _NET_WM_WINDOW_TYPE_SPLASH in EWMH specification.
The behavior of dialog with this option is HIGHLY DEPENDS on settings of
your window manager.
This option is deprecated. Use --window-type instead.
- --window-type=TYPE
- Create a window with the specified window type. TYPECan be one of
normal, dialog, utility, dock, desktop,
tooltip, notification or splash. The behavior of each
window type depends on your window manager. See EWMH specification for
details.
NOTE: Tiling window managers will often float a "dialog" window but tile a "normal" window.
- --no-focus
- Dialog window never take focus.
- --close-on-unfocus
- Close the dialog window when it loses focus.
- --selectable-labels
- If set, user can select dialog's text and copy it to clipboard. This option also affects on label fields in form dialog.
- --image-path=PATH
- Add specified path to the standard list of directories for looking for icons. This option can be used multiple times.
- --rest=FILENAME
- Read extra arguments from given file instead of command line. Each line of a file treats as a single argument.
- --response=NUMBER
- Set default exit code to NUMBER instead of 0.
- --css=STRING
- Read and parse additional GTK+ CSS styles from given data. If STRING is filename, the content of file is loaded. If not STRING treats like CSS data.
- --gtkrc=FILENAME (Deprecated)
- Read and parse additional GTK+ CSS styles from given file. This option is deprecated. Use --css instead.
- --hscroll-policy=TYPE
- Set the policy type for horizontal scrollbars. TYPE can be one of the auto, always or never. Default is auto.
- --vscroll-policy=TYPE
- Set the policy type for vertical scrollbars. TYPE can be one of the auto, always or never. Default is auto.
- --enable-spell
- Enable spell checking in textview widgets
- --spell-lang=LANGUAGE
- Set spell checking language to LANGUAGE. By default language guesses from current locale. Use yad-tools(1) to get list of all possible languages.
- --bool-fmt=TYPE
- Set the output type of boolean values to TYPE. Possible types are
T, t, Y, y, O, o and 1.
T and t - for true/false pair in appropriate case.
Y and y - for yes/no pair in appropriate case.
O and o - for on/off pair in appropriate case.
1 - for 1/0 pair.
Custom about dialog options
- --pname=STRING
- Set programm name.
- --image=IMAGE
- Set programm icon name.
- --pversion=STRING
- Set programm version string.
- --copyright=STRING
- Set programm copyrightstring.
- --comments=STRING
- Set programm detailed description.
- --license=STRING
- Set programm license. The value of this option can be one of predefined licenses (GPL2, GPL3, LGPL2, LGPL3, BSD, MIT or ARTISTIC,), file name with license text or arbitrary string.
- Set list of programm authors separated by comma.
- --website=URI
- Set a link to programm website.
- --website-label=LABEL
- Set a label for programm website link.
Application selection options
- --enable-fallback
- Show fallback applications.
- --enable-other
- Show other applications.
- --enable-all
- Show all available applications.
- --extened
- Shown extended information about choosen application. By default only executable is shown. In extended form the output fields are name, display name, description, icon and executable.
Additional argument for application dialog is a mime-type. If mime-type is not specified text/plain will be used.
Calendar options
- --day=NUMBER
- Set the calendar day.
- --month=NUMBER
- Set the calendar month.
- --year=NUMBER
- Set the calendar year.
- --date-format=PATTERN
- Set the format for the returned date. By default is `%x'. See strftime(3) for more details.
- --show-weeks
- Show the week numbers at the left side of calendar.
- --details=FILENAME
- Read days description from FILENAME.
File with days details must be in following format:
- <date> <description>
date field is date in format, specified with --date-format option. description is a string with date details, which may include Pango markup.
Color selection options
- --init-color=COLOR
- Set initial color value.
- --gtk-palette
- Show system palette inside color dialog. For GTK+3 builds this option shows palette instead of color editor.
- --picker
- Add screen color picker button.
- --alpha
- Add opacity to output color string.
- --palette=[FILENAME]
- Show palette and set predefined colors from given filename. By default yad use file /etc/X11/rgb.txt.
- --expand-palette
- Expander for list of user-defined colors will be initially opened.
- --mode=MODE
- Set output color mode. Possible values are hex or rgb. Default is hex. HEX mode looks like #rrggbbaa, RGB mode - rgba(r, g, b, a). In RGBA mode opacity have values from 0.0 to 1.0.
Drag-and-Drop box options
- --tooltip
- Use dialog text as a tooltip for Drag-and-Drop box.
- --command=CMD
- Run command when data received. Data strings pass to command as an argument or replace %s modifier in a command. By default data just prints to stdout.
- --exit-on-drop=NUMBER
- Exit after NUMBER of drops was reached. 0 means infinite number of drops, this is the default.
Text entry options
- --entry-label=STRING
- Set the entry label text.
- --entry-text=STRING
- Set the initial entry text or default item in combo-box.
- --hide-text
- Hide the entry text.
- --completion
- Use completion instead of combo-box.
- --complete=TYPE
- Use specific type for extended completion. TYPE can be any for match any of typed words, all for match all of typed words or regex when typed text treats as regular expression.
- --editable
- Allow make changes to text in combo-box.
- --numeric
- Use spin button instead of text entry. Additional parameters in command line treats as minimum and maximum values, step value and precisions (in that order). All this values are optional. Default range is from 0 to 65535 with step 1.
- --float-precision=NUMBER
- Set precision of floating point numbers. By default precision is three digits after point.
- --licon=IMAGE
- Set an icon on a left side of entry.
- --licon-action=CMD
- Specify a command which will be run when the left icon clicked. Output of command will be set as entry text.
- --ricon=IMAGE
- Set an icon on a right side of entry.
- --ricon-action=CMD
- Specify a command which will be run when the right icon clicked. Output of command will be set as entry text.
- --num-output
- Output index of active element instead of text for combo-box entry.
Any extra data specified in command line adds as an items of combo-box entry, except of numeric mode.
If icon specified and icon action is not given, click on icon just clear the entry. Numeric fields will ignore the icons.
Iconbox options
- --read-dir=PATH
- Read .desktop files from specified directory.
- --monitor
- Watch for changes in directory and automatically update content of iconbox.
- --generic
- Use field GenericName instead of Name for shortcut label.
- --sort-by-name
- Use field Name instead of filename for sorting items.
- --descend
- Sort items in descending order. If data reads from stdin this option is useless without --sort-by-name.
- --listen
- Read data from stdin. Data must be in order - Name, Tooltip, Icon, Command, InTerm separated by newline. InTerm is a case insensitive boolean constant (TRUE or FALSE). Sending FormFeed character clears iconbox.
- --item-width
- Set items width.
- --icon-size
- Force using specified icon size. This option doesn't work in compact mode.
- --compact
- Use compact mode. Icon and name of each item is placed in a single row.
- --single-click
- Activate items by single mouse click. This option may not works properly in case of compact mode.
- --term
- Pattern for terminal. By default use `xterm -e %s' where %s replaced by the command.
If both directory and stdin specified, content of iconbox will be read from directory.
File selection options
- --filename=FILENAME
- Set the filename.
- --multiple
- Allow selection of multiple filenames in file selection dialog.
- --directory
- Activate directory-only selection.
- --save
- Activate save mode.
- --separator=STRING
- Specify separator character when returning multiple filenames.
- --confirm-overwrite=[TEXT]
- Confirm file selection if filename already exists. Optional argument is a text for confirmation dialog.
- --quoted-output
- Output values will be shell-style quoted.
Font selection options
- --fontname=FONTNAME
- Set the initial font. FONTNAME is a string with font representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]".
- --preview
- Set the preview text.
- --separate-output
- Separate output of selected font description.
- --separator=STRING
- Set output separator character. Default is `|'.
- --quoted-output
- Output data will be in shell-style quotes.
Form options
- --field=LABEL[!TOOLTIP][:TYPE]
- Add field to form. Type may be H, RO, NUM,
CHK, CB, CBE, CE, FL, SFL,
DIR, CDIR, FN, MFL, MDIR, DT,
SCL, SW, APP, ICON, CLR, BTN,
FBTN, LINK, LBL or TXT.
H - hidden field type. All characters are displayed as the invisible char.
RO - field is in read-only mode.
NUM - field is a numeric. Initial value format for this field is VALUE[!RANGE[!STEP![PREC]]], where RANGE must be in form MIN..MAX. `!' is a default item separator. PREC is a precision for decimals.
CHK - checkbox field. Initial value is a case insensitive boolean constant (TRUE or FALSE).
CB - combo-box field. Initial value is a list VAL1!VAL2!.... The separator is the same as in NUM field. Value started with `^' threats as default for combo-box.
CBE - editable combo-box field. Initial value same as for combo-box.
CE - entry with completion. Initial value same as for combo-box.
FL - file selection button.
SFL - field for create file.
DIR - directory selection button.
CDIR - field for create folder.
FN - font selection button. Initial value same as in font dialog.
MFL - select multiple files. Value of this field is a list of files separated by item-separator.
MDIR - select multiple folders. Value of this field is a list of folders separated by item-separator.
DT - date field.
SCL - scale field. Value of this field in a range 0..100.
SW - switch field. Initial value is a case insensitive boolean constant (TRUE or FALSE).
APP - application selection button. Input value for this field is mime-type. Output value - executable for selected application.
ICON - icon field. Like average entry field but has two icons. Left shows current icon and right is clickable and calls yad-con-browser for choosing icon.
CLR - color selection button. Output values for this field generates in the same manner as for color dialog.
BTN - button field. Label may be in form text in a form LABEL[!ICON[!TOOLTIP]] where `!' is an item separator. LABEL is a text of button label or yad stock id. ICON is a buttons icon (stock id or file name). TOOLTIP is an optional text for popup help string. Initial value is a command which is running when button is clicked. A special sympols %N in command are replaced by value of field N. If command starts with @, the output of command will be parsed and lines started with number and colon will be treats as a new field values. A quoting style for value when sh -c is used - a single quotes around command and double quotes around -c argument
FBTN - same as button field, but with full relief of a button.
LINK - link button field.
LBL - text label. If field name is empty, horizontal separator line will be shown.
TXT - multiline text entry. This field is always occupy all of form width.Without type field will be a simple text entry.
- --align=TYPE
- Set alignment of field labels. Possible types are left, center or right. Default is left.
- --columns=NUMBER
- Set number of columns in form. Fields will be placed from top to bottom.
- --separator=STRING
- Set output separator character. Default is `|'.
- --focus-field=NUMBER
- Set focused field.
- --cycle-read
- Cycled reading of stdin data. Sending FormFeed character clears the form. This symbol may be sent as echo -e '\f'.
- Align label on button fields according to --align settings.
- --item-separator=STRING
- Set separator character for combo-box or scale values. Default is `!'.
- --date-format=PATTERN
- Set the format for the date fields (same as in calendar dialog).
- --float-precision=NUMBER
- Set precision of floating point numbers. By default precision is three digits after point.
- --complete=TYPE
- Use specific type for extended completion. TYPE can be any for match any of typed words, all for match all of typed words or regex when typed text treats as regular expression.
- --scroll
- Make form scrollable.
- --homogeneous
- Makes form fields height ans columns width the same size.
- --changed-action=CMD
- Run CMD when CHK, CB, or SW field value is changed. Command runs with two arguments - number of changed field and its current value. Output of a command parsing in a same manner as in BTN fields with @ prefix. Attention - this option may slow down your dialog.
- --quoted-output
- Output values will be in shell-style quotes.
- --output-by-row
- Output field values row by row if several columns is specified.
- --num-output
- Output index of active element instead of text for combo-box fields.
Additional data in command line interprets as a default values for form fields. A special value @disabled@ makes corresponding field inactive. If no extra arguments specified in a command line, data will be readed from stdin, one value per line. Cycled reading means that for N fields N+1 value will replace the first field. Empty values are skipped when reading from stdin.
HTML options
- --uri=URI
- Open specified location. URI can be a filename or internet address. If URI is not an existing file and protocol is not specified a prefix http:// will be added to URI.
- --browser
- Turn on browser mode. In this mode all clicked links will be opened in html widget and command Open will be added to context menu.
- --print-uri
- Print clicked links to standard output. By default clicked links opens with xdg-open.
- --mime=MIME
- Set mime type of data passed to standard input to MIME. Default is text/html.
- --encoding=ENCODING
- Set encoding of data passed to standard input to ENCODING. Default is UTF-8.
- --uri-handler=CMD
- Set external handler for clicked uri. %s will be replaced by activated uri. Return code of the CMD must be 0 for keep working, 1 for ignoring uri and 2 for downloading uri. This option works only in browser mode. There are two environment variables available in handler - YAD_HTML_BUTTON with value of pressed mouse button and YAD_HTML_STATE with value of bitmask with the the state of the modifier keys.
- --user-agent=STRING
- Set user agent string. Default is YAD-Webkit (@VERSION@)
- --user-style=STRING
- Load custom custom user styles from file or arbitrary data. STRING may be a path to local file with CSS code or CSS code itself.
- --disable-search
- Disable search bar.
- --file-op
- Enable file operations. This option adds open menu item to popup menu,
- --wk-prop=PROP
- Set additional WebKit setting. This option may be used multiply times. Setting PROP must be in a form "setting-name value". First character of value must be a type identifier b for booleans, i for integers and s for strings. The values itself following by a colon. List of possible settings can be found on this page - https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html
When dialog works in browser mode additional data in command line interprets as URI.
List options
- --column=STRING[:TYPE]
- Set the column header. Types are TEXT, NUM, SZ,
FLT, CHK, RD, BAR, IMG, HD or
TIP. TEXT type is default. Use NUM for integers and
FLT for double values. TIP is used for define tooltip
column. SZ size column type. Works exactly like NUM column
but shows human readable sizes instead of numbers. CHK (checkboxes)
and RD (radio toggle) are a boolean columns. BAR is a
progress bar column. Value must be between 0 and 100. If
value is outside is range it will be croped to neares legal value.
HD type means a hidden column. Such columns are not displayes in
the list, only in output. IMG may be path to image or icon name
from currnet GTK+ icon theme. Size of icons may be set in gtk config file
at GTK_ICON_SIZE_MENU position of gtk-icon-sizes. Images specified by icon
names will be scaled to GTK_ICON_SIZE_MENU until --force-icon-size
option is not sets. Image field prints as empty value.
Special column names @fore@, @back@ and @font@ sets corresponding rows attributes. Values of those columns don't show in results.
Column title can be specified in form name!tooltip and Pango markup can be used in name and tooltip parts.
- --tree
- Enbale tree mode. In this mode extra data in form ROW_ID[:PARENT_ID] must be passed to yad before each row. See EXAMPLES for details.
- --checklist
- Use check boxes for the first column. Output checked rows instead of selected rows. Disable multiple selection.
- --radiolist
- Same as --checklist but with a radio toggle for the first column.
- --separator=STRING
- Set output separator characters.
- --multiple
- Allow multiple rows to be selected.
- --editable
- Allow changes to text.
- --editable-cols=LIST
- Set the list of editable columns. LIST must be a string of numbers separated by comma.
- --no-headers
- Do not show column headers.
- --no-click
- Disable sorting of column content by clicking on its header.
- --no-rules-hint
- Don't draw even and odd rows by a different colors. This option depends on your current gtk theme and may not work.
- --grid-lines=TYPE
- Draw grid lines of type TYPE in list dialog. TYPE can be one of the hor[izontal], vert[ical] of both.
- --no-selection
- Disable selection in list.
- --print-all
- Print all data from the list.
- --print-column=NUMBER
- Specify what column will be printed to standard output. 0 may be used to print all columns (this is default).
- --hide-column=NUMBER
- Hide a specific column.
- --expand-column=NUMBER
- Set the column expandable by default. 0 sets all columns expandable.
- --search-column=NUMBER
- Set the quick search column. 0 mean to disable searching. By default search mades on first column.
- --tooltip-column=NUMBER
- Set the column with popup tooltips.
- --sep-column=NUMBER
- Set the row separator column. If the cell value from this column equal to specified row separator value such row will be draw as separator. Separator value must be set.
- --sep-value=TEXT
- Set the TEXT as a row separator value. This feature highly depends on your current GTK+ theme and may not work properly.
- --limit=NUMBER
- Set the number of rows in list dialog. Will be shown only the last NUMBER rows. This option will take effect only when data reading from stdin.
- --wrap-width=NUMBER
- Set the width of column before wrapping to NUMBER.
- --wrap-cols=LIST
- Set the list of wrapped columns. LIST must be a string of numbers separated by comma.
- --ellipsize=TYPE
- Set ellipsize mode for text columns. TYPE may be NONE, START, MIDDLE or END.
- --ellipsize-cols=LIST
- Set the list of ellipsized columns. LIST must be a string of numbers separated by comma.
- --dclick-action=CMD
- Set the CMD as a double-click command. When user double-clicked on row, CMD will be launched with values of all columns as an arguments. By default double-click selects row and act as OK button for simple lists, set the checkbox if --checklist specified and do nothing when list run with --multiple option. When double-click specified Enter acts as a double-click and Ctrl+Enter acts as an OK button. CMD may contain a special character `%s' for setting a position for arguments. By default arguments will be concatenated to the end of CMD. If CMD starts with @, its output will replace values of current row. This option doesn't work with --editable.
- --select-action=CMD
- Set the CMD as a action when selection is changed. CMD will be launched with values of all columns as an arguments. CMD may contain a special character `%s' for setting a position for arguments. By default arguments will be concatenated to the end of CMD. This option doesn't work with --multiple.
- --row-action=CMD
- Set the CMD as a action when the row is added, modified or removed. First argument for the command is the name of action (add, edit or del). The rest of command line is data from selected row. Output of this command sets the new row values.
- --tree-expanded
- Expand all tree nodes at startup.
- --regex-search
- Use regular expressions in search for text fields.
- --listen
- Listen data from stdin even if command-line values was specified.
- --quoted-output
- Output values will be shell-style quoted.
- --float-precision=NUMBER
- Set precision of floating point numbers. By default precision is three digits after point.
- --add-on-top
- Add new records at the top of the list.
- --tail | --auto-scroll
- Autoscroll to the end of the list when a new row will be added.
- --iec-format
- Use IEC (base 1024) units with for size values. With this option values will have suffixes KiB, MiB, GiB.
- --simple-tips
- Don't use markup in tooltips even if text has a valid markup.
- --header-tips
- Use header name as a fallback tooltip text.
- --column-align=STRING
- Set alignment for columns. STRING must contain array of letters l, r or c for left, center or right alignment of column content.
- --header-align=STRING
- Set alignment for column headers. STRING same as in --column-align.
Sending FormFeed character to list clears it. This symbol may be sent as echo -e '\f'.
Notebook options
- --key=KEY
- Set the key of the children.
- --tab=TEXT
- Add tab with specified label to notebook. TEXT may be in a form LABEL[!ICON[!TOOLTIP]] where `!' is an item separator. For stack mode TEXT for label uses as is.
- --tab-pos=TYPE
- Set the tabs position. Value may be top, bottom, left, or right. Default is top. For stack mode only top or bottom positions available.
- --tab-borders=NUMBER
- Set the borders width around widget in tabs.
- --active-tab=NUMBER
- Set active tab.
- --expand
- Expand all tabs to full width of a dialog window.
- --stack
- Use stack mode (GtkStack instead of GtkNotebook).
See NOTEBOOK and PANED section for more about notebook dialog.
Notification options
- --command=CMD
- Set the command running when clicked on the icon. Default action is quit if --listen not specified.
- --listen
- Listen for commands on stdin. See NOTIFICATION section.
- --separator=STRING
- Set separator character for menu values. Default is |.
- --item-separator=STRING
- Set separator character for menu items. Default is !.
- Set initial menu for right-click.
- --no-middle
- Disable exit on middle click.
- Doesn't show icon at startup.
- --icon-size=SIZE
- Set notification icon size to SIZE. This option doesn't works for themed icons.
See NOTIFICATION section for more about separators.
Paned options
- --key=KEY
- Set the key of the children.
- --orient=TYPE
- Set orientation of panes inside dialog. TYPE may be in hor[izontal] or vert[ical].
- --splitter=POS
- Set the initial splitter position.
- --focused=PANE
- Set pane for initial focus. PANE must be 1 or 2. Default is 1.
See NOTEBOOK and PANED section for more about paned dialog.
Picture options
- --size=VALUE
- Set initial size of picture. Available values are fit for fitting image in window or orig for show picture in original size.
- --inc=NUMBER
- Set increment value for scaling image.
- --filename=FILENAME
- Set picture filename. If no file name is specified extra data will be used. In this case several filenames can be specified.
- --file-op
- Enable file operations. This option adds open menu item to popup menu,
- --image-changed=CMD
- Set command which runs after changing image. Argument of a command is a filename of current image. Argument can be specified by '%s' pattern or will be the last part of a command.
Some actions on a picture like navigation, scaling or rotating available from popup menu. Those actions can be made only on static images.
Print options
- --type=TYPE
- Set source file type. TYPE may be a TEXT for text files, IMAGE for image files or RAW for files in postscript or pdf formats.
- --filename=FILENAME
- Set name or path to the source file.
- --headers
- Add headers to the top of page with filename and page number. This option doesn't work for RAW type.
- --add-preview
- Add Preview button to the print dialog. This option doesn't work for RAW type.
- --fontname=FONTNAME
- Set the font for printing text. FONTNAME is a string with font representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]". This option works only for TEXT type.
Progress options
When the --progress option is used, yad reads lines of progress data from stdin. When the lines begin with # the text after # is displayed in the progress bar label. Numeric values treats like a percents for progress bar.
- --bar=LABEL[:TYPE]
- Add progress bar. LABEL is a text label for progress bar. TYPE is a progress bar type. Types are: NORM for normal progress bar, RTL for inverted progress bar and PULSE for pulsate progress bar. If no bars specified, the progress dialog works in single-bar mode.
- --vertical
- Set vertical orientation of progress bars.
- --align=TYPE
- Set alignment of bar labels. Possible types are left, center or right. Default is left.
- --progress-text=TEXT
- Set the label of progress bar to TEXT. This option works only in single-bar mode.
- --hide-text
- Hide text in progress bars.
- --rtl
- Set Right-To-Left progress bar direction. This option works only in single-bar mode.
- --auto-close
- Close dialog when 100% has been reached.
- --auto-kill
- Kill parent process if cancel button is pressed.
- --pulsate
- Pulsate progress bar. This option works only in single-bar mode.
- --scroll
- Make layout scrollable.
- --enable-log[=TEXT]
- Show log window. This window gathers all of lines from stdin, started from # instead of setting appropriate progress text. Optional argument TEXT is a text label for window expander.
- --log-on-top
- Place log window above progress bars.
- --log-expanded
- Start with expanded log window.
- --log-height
- Set the height of log window.
Initial values for bars sets as an extra arguments. Each lines with progress data passed to stdin must be started from N: where N is a number of progress bar. In a single-bar mode N: is not needed.
Text info options
- --filename=FILENAME
- Open specified file.
- --editable
- Allow changes to text.
- --wrap
- Enable text wrapping.
- --formatted
- Enable Pango markup. This option doesn't work with --editable option.
- --justify=TYPE
- Set justification. TYPE may be left, right, center or fill. Default is left.
- --margins=NUMBER
- Set text margins to NUMBER.
- --tail | --auto-scroll
- Autoscroll to end when new text appears. This option works only when text is read from stdin.
- --line=NUMBER
- Jump to specific line at startup. This option works only when filename was specified
- --show-cursor
- Show cursor in read-only mode.
- --show-uri
- Make links in text clickable. Links opens with xdg-open command.
- --fore=COLOR
- Set default color for text.
- --back=COLOR
- Set default color for background.
- --uri-color=COLOR
- Set color for links. Default is blue.
- --listen
- Listen data from stdin even if filename was specified.
- --in-place
- Save file on exit instead of print it content on stdout. This option works only if file was specified from command-line.
- --file-op
- Enable file operations. This option adds open and save menu items to popup menu, This option works only in editable mode.
- --disable-search
- Disable search bar.
- --confirm-save=[TEXT]
- Confirm file saving if file content was changed. This option works only when --in-place is specified. Optional argument is a text for confirmation dialog.
- Next options works only if yad builds with GtkSourceView.
- --lang=LANGUAGE
- Highlight syntax for specified LANGUAGE.
- --theme=THEME
- Set used theme to THEME. Use yad-tools(1) to get list of all available themes.
- --mime=TYPE
- Specify mime type of input data. This options only needed for guessing appropriate syntax highlighting.
- --line-num
- Show line numbers.
- --line-hl
- Highlight current line.
- --line-marks
- Enable line marks mode. There are two types of marks. First type sets by left mouse button and second by the right mouse button.
- --mark1-color=COLOR
- Set background color for marks of first type to COLOR. Default is lightgreen.
- --mark2-color=COLOR
- Set background color for marks of second type to COLOR. Default is pink.
- --right-margin=[POS]
- Enable mark of right margin. Optional argument POS is a margin position in characters. Default is 80.
- --brackets
- Highlight matching brackets.
- --indent
- Enable autoindent. This option also sets TAB key as indent key.
- --smart-he=TYPE
- Set behavior of HOME and END keys. The TYPE is one of newer, before, after or always.
- --smart-bs
- Enable smart mode for BackSpace. If this option is enabled BackSpace will delete spaces to the next tab position.
- --tab-width
- Set tabulation step.
- --indent-width
- Set indentation step.
- --spaces
- Insert spaces instead of tabulation.
If fontname option is specified for text dialog, the description of font must be in CSS style (not in a Pango style). Sending FormFeed character to text dialog clears it. This symbol may be sent as echo -e '\f'. Pressing Ctrl+S popups the search entry in text dialog.
Scale options
- --value=VALUE
- Set initial value.
- --min-value=VALUE
- Set minimum value.
- --max-value=VALUE
- Set maximum value.
- --step=VALUE
- Set step size.
- --enforce-step
- Only allow values in step increments.
- --page=VALUE
- Set paging size. By default page value is STEP*10.
- --print-partial
- Print partial values.
- --hide-value
- Hide value.
- --vertical
- Show vertical scale.
- --invert
- Invert scale direction.
- Show buttons on edges of a scale for increasing or decreasing scale value.
- --mark=[NAME]:VALUE
- Add a mark to scale. May be used multiple times. NAME is an optional arguments for set label to mark.
File filters options
- --file-filter=NAME | PATTERN1 PATTERN2 ...
- Add a filename filter. NAME is a displayed filter name, PATTERN is a shell-style filename pattern (for example *.txt). This option may be used multiple times.
- --mime-filter=NAME | MIME1 MIME2 ...
- Add a mime-type filter. NAME is a displayed filter name, PATTERN is a name of mime type (for example text/plain). This option may be used multiple times.
- --image-filter=[NAME]
- Add filter for images supported by gdk-pixbuf library. NAME in as optional name for this filter.
- This options applies to all of yad's file chooser dialogs.
File preview options
- --add-preview
- Add preview widget. Preview images loads from normal (default) or large thumbnails according to XDG Thumbnails specification v0.8.0 (http://standards.freedesktop.org/thumbnail-spec/latest/) or creates by yad for image files and saves as normal or large thumbnails.
- --large-preview
- Use large previews by default. This option can be permanently turned on through yad settings.
- This options applies to all of yad's file chooser dialogs.
- NOTE: YAD doesn't check mtime for thumbnailed images and doesn't updates preview if origial file was changed after thumbnail was created.
Miscellaneous options
- -?, --help
- Show summary of options.
- --about
- Display an about dialog.
- --version
- Show version of program.
Also the standard GTK+ options are accepted.
NOTEBOOK and PANED
Notebook is a complex dialog which swallow other dialogs in his tabs. Dialogs identifies by unique key (integer) and must be runs in a special plug mode (--plug option). Following example runs notebook dialog with two tabs, first has a simple text and second is an entry dialog.
#! /bin/sh yad --plug=12345 --tabnum=1 --text="first tab with text" &> res1 & yad --plug=12345 --tabnum=2 --text="second tab" --entry &> res2 & yad --notebook --key=12345 --tab="Tab 1" --tab="Tab 2"
NOTE: The order of output results for tabs is undefined!
Paned works in a same manner as a notebook with one restriction - only first and secong plug dialogs will be swallowed to panes.
NOTIFICATION
Allows commands to be sent to yad in the form command:args. Possible commands are icon, tooltip, visible, action, menu and quit.
- icon:ICONNAME
- Set notification icon to ICONNAME.
- tooltip:STRING
- Set notification tooltip.
- visible:[true|false]
- Set notification icon to visible or invisible state.
- action:COMMAND
- Specify the command running when click on the icon. There are two special commands - menu for popup user defined menu and quit for exit the program.
- Set popup menu for notification icon. STRING must be in form name1[!action1[!icon1]]|name2[!action2[!icon2]].... Empty name add separator to menu. Separator character for values (e.g. `|') sets with --separator argument. Separator character for menu items (e.g. `!') sets with --item-separator argument.
- quit
- Exit the program. Middle click on icon also send quit command.
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 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
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.
USER DEFINED SIGNALS
EXIT STATUS
- 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
- Exit codes for user-specified buttons must be specified in command line. Even exit code mean to print result, odd just return exit code.
WIDGETS NAMES
- The look and feel of yad's dialogs can be customized through gtkrc file. Here is the names of yad's widgets:
-
Widget name Widget type Description yad-dialog-window GtkDialog Dialog window yad-dialog-image GtkImage Dialog image yad-dialog-label GtkLabel Dialog text yad-app-widget GtkAppChooserWidget Application selection widget yad-calendar-widget GtkCalendar Calendar widget yad-color-widget GtkColorChooser Color selection widget yad-color-palette GtkTreeView Predefined colors list yad-entry-label GtkLabel Entry label yad-entry-widget GtkEntry Entry widget yad-entry-spin GtkSpinButton Entry widget for numeric values yad-entry-combo GtkComboBox Entry widget with combo yad-entry-edit-combo GtkComboBoxEntry Entry widget with editable combo yad-file-widget GtkFileChooser File selection widget yad-font-widget GtkFontChooser Font selection widget yad-form-flabel GtkLabel Field label in form yad-form-button GtkButton Button field in form yad-form-entry GtkEntrfy Entry field in form yad-form-spin GtkSpinButton Numeric entry field in form yad-form-check GtkCheckButton Checkbox field in form yad-form-combo GtkComboBox Combo field in form yad-form-edit-combo GtkComboBoxEntry Editable combo field in form yad-form-link GtkLinkButton Link field in form yad-form-file GtkFileChooserButton File or directory field in form yad-form-font GtkFontChooserButton Font field in form yad-form-app GtkAppChooserButton Application field in form yad-form-switch GtkSwitch Switch field in form yad-form-color GtkColorChooserButton Color field in form yad-form-label GtkLabel Label field in form yad-form-scale GtkScale Scale widget in form yad-form-separator GtkSeparator Separator in form yad-form-text GtkTextView Multiline text field in form yad-icons-full GtkIconView Icons widget for normal mode yad-icons-compact GtkTreeView Icons widget for compact mode yad-list-widget GtkTreeView List widget yad-notebook-widget GtkNotebook Notebook widget yad-paned-widget GtkPaned Horizontal or vertical pane widget yad-progress-widget GtkProgressBar Progressbar widget yad-scale-widget GtkScale Scale widget yad-stack-widget GtkStack Stack widget yad-stack-switcher-widget GtkStackSwitcher Stack switcher widget yad-text-widget GtkTextView Text info widget yad-timeout-indicator GtkProgreeBar Timeout indicator
SETTINGS
YAD keeps settings in gsettings database. Use gsettings list-keys yad.settings to get list of available settings. Settings values can be obtained by gsettings get yad.settings <key> and changed by gsettings set yad.settings <key> <new-value>
EXAMPLES
Display a file selector with the title Select a file to remove. The file selected is returned on standard output.
- yad --title="Select a file to remove" --file-selection
Display a text entry dialog with the title Select Host and the text Select the host you would like to flood-ping. The entered text is returned on standard output.
- yad --title "Select Host" --entry --text "Select the host you would like to flood-ping"
Display a dialog, asking Microsoft Windows has been found! Would you like to remove it?. The return code will be 0 (true in shell) if YES is selected, and 1 (false) if NO is selected.
- yad --image "dialog-question" --title "Alert" --button=gtk-yes:0 --button=gtk-no:1 --text "Microsoft Windows has been found! Would you like to remove it?"
Show the search results in a list dialog with the title Search Results and the text Finding all header files....
- find . -name '*.h' | yad --list --title "Search Results" --text "Finding all header files.." --column "Files"
Show an icon in the notification area
- yad --notification --image=update.png --text "System update necessary!" --command "xterm -e apt-get upgrade"
Display a weekly shopping list in a check list dialog with Apples and Oranges pre selected
- yad --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges FALSE Pears FALSE Toothpaste
Display a progress dialog while searching for all the postscript files in your home directory
- find $HOME -name '*.ps' | yad --progress --pulsate
Display a box with all of the installed desktop applications
- yad --icons --read-dir=/usr/share/applications
Display list in tree mode
- yad --list --tree --column "Items" f Fruits 1:f Apple 2:f Lemon v Vegetables 3:v Popato 4:v Onion
DEVELOPMENT
There are some developers features providing with YAD.
- yad-icon-browser [theme]
When using autoconf you may use special m4 macro AM_PATH_YAD for looking for yad and check it version. Usage of this macro is
- AM_PATH_YAD([MINIMUM-VERSION],\ [ACTION-IF-FOUND],\ [ACTION-IF-NOT-FOUND])
AUTHORS
Yad was written by Victor Ananjevsky <ananasik@gmail.com>. Yad icon created by Bogdan Lisovich.
SEE ALSO
June 2024 | yad |