YAD(1)
okay bestie, welcome to YAD(1) β the User Commands page for yad, and it's literally giving iconic shell-script-dialog energy. grab a lil snack, we're going through every option together π
β¨ NAME β¨
yad β display GTK+ dialogs from shell scripts or command-line. yes, that's the whole vibe: GTK+ dialogs, but make it scriptable π«Ά
πΈ SYNOPSIS πΈ
yad [OPTIONS]
π DESCRIPTION π
YAD is a program that displays GTK+ dialogs and returns the user's input β either in the return code or on standard output. so you can present information to the user and ask for information back from, like, all manner of shell scripts. main character energy fr fr β¨
YAD is the fork of the Zenity program. no cap.
π OPTIONS π
bestie, this program follows the usual GNU command line syntax, with long options starting with two dashes. okay so let's go π
π Dialog options π
--aboutβ display the about dialog.--appβ display the application selection dialog.--calendarβ display the calendar dialog.--colorβ display the color selection dialog.--dndβ display a drag-and-drop box.--entryβ display the text entry dialog.--iconsβ display a box with shortcut icons.--fileβ display the file selection dialog.--fontβ display the font selection dialog.--formβ display the form dialog.--htmlβ display the HTML dialog.--listβ display the list dialog.--notebookβ display the notebook dialog.--notificationβ display the notification icon.--appindicatorβ display the appindicator icon.--popupβ display a popup message dialog.--printβ display the print dialog.--progressβ display the progress indication dialog.--scaleβ display the scale dialog.--text-infoβ display the text information 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 the dialog window.NUMBERcan be negative.--posy=NUMBERβ set the Y position of the dialog window.NUMBERcan be negative.--geometry=WIDTHxHEIGHT+X+Yβ use standard X Window geometry notation for placing the dialog. when this option is used, thewidth,height,posx,posy,mouseandcenteroptions are ignored. periodt.--timeout=TIMEOUTβ set the dialog timeout in seconds.--timeout-indicator=POSITIONβ show the timeout indicator in the given position. positions aretop,bottom,leftorright. style of the indicator may be set through the user's CSS styles.--kill-parent=[SIGNAL]β sendSIGNALto the parent process. default value ofSIGNALis aSIGTERM.SIGNALmay be specified by its number or symbolic name with or without theSIGprefix. seesignal(7)for details about signals.--print-xid=[FILENAME]β output the X Window ID of a yad's window to the specified file or to stderr.--plug=KEYβ run the dialog in plug mode for swallow as a notebook tab. see the NOTEBOOK section for more.--tabnum=NUMBERβ set the tab number for the plugged dialog. see the 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 the type of dialog text justification.TYPEmay beleft,right,centerorfill.--image=IMAGEβ set the dialog image which appears on the left side of the dialog's text.IMAGEmight be a file name or an icon name from the current icon theme.--icon-theme=THEMEβ use the specified GTK icon theme instead of the default.--keep-icon-sizeβ don't scale icons. this option affects icons outside the icon theme.--expander=[TEXT]β hide the main widget with an expander.TEXTis an optional argument with the expander's label.--button=BUTTON:IDβ add a dialog button. may be used multiple times.IDis an exit code or a command.BUTTONmay be a yad stock item name for predefined buttons (likeyad-closeoryad-ok) or text in the formLABEL[!ICON[!TOOLTIP]]where!is an item separator. full list of stock items may be found in the STOCK ITEMS section. if no buttons are specified,OKandCancelbuttons are used. see the EXIT STATUS section for more. ifIDhas a non-numeric value it's treated as a command, and clicking on such a button doesn't close the dialog.--no-buttonsβ don't show buttons.--buttons-layout=TYPEβ set the buttons layout type. possible types arespread,edge,start,endorcenter. default isend.--no-markupβ don't use pango markup in the dialog's text.--no-escapeβ don't close the dialog if Escape was pressed.--escape-okβ Escape acts like pressing theOKbutton.--always-print-resultβ print the 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 run under the specified interpreter. default isbash -c "%s". this option can reduce quoting in commands. if%sis specified, it will be replaced by the command. otherwise the command will be appended to the end of the command line.--uri-handler=CMDβ useCMDas the uri handler. by default yad uses theopen-commandparameter from settings. the URI replaces%sin the command string or is added as the last part of the command line.--f1-action=CMDβ set the command running when F1 was pressed.--workdir=PATHβ set the current working directory toPATH.--borders=NUMβ set the dialog window borders.--stickyβ make the window visible on all desktops.--fixedβ make the window fixed width and height.--centerβ place the window in the center of the screen.--mouseβ place the window under the mouse position.--on-topβ place the window over other windows.--undecoratedβ make the window undecorated (remove title and window borders).--skip-taskbarβ don't show the window in the taskbar and pager.--maximizedβ run the dialog window maximized.--fullscreenβ run the dialog in fullscreen mode. this option may not work on all window managers.--window-type=TYPEβ create a window with the specified window type.TYPEcan be one ofnormal,dialog,utility,dock,desktop,tooltip,notificationorsplash. the behavior of each window type depends on your window manager. see the EWMH specification for details.
NOTE: Tiling window managers will often float a "dialog" window but tile a "normal" window.
--no-focusβ the dialog window never takes focus.--close-on-unfocusβ close the dialog window when it loses focus.--selectable-labelsβ if set, the user can select the dialog's text and copy it to the clipboard. this option also affects label fields in the form dialog.--image-path=PATHβ add the 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 the given file instead of the command line. each line of the file is treated as a single argument.--response=NUMBERβ set the default exit code toNUMBERinstead of0.--css=STRINGβ read and parse additional GTK+ CSS styles from the given data. ifSTRINGis a filename, the content of the file is loaded. if not,STRINGis treated like CSS data.--gtkrc=FILENAME(Deprecated) β read and parse additional GTK+ CSS styles from the given file. this option is deprecated. use--cssinstead.--hscroll-policy=TYPEβ set the policy type for horizontal scrollbars.TYPEcan be one ofauto,alwaysornever. default isauto.--vscroll-policy=TYPEβ set the policy type for vertical scrollbars.TYPEcan be one ofauto,alwaysornever. default isauto.--enable-spellβ enable spell checking in textview widgets.--spell-lang=LANGUAGEβ set spell checking language toLANGUAGE. by default the language is guessed from the current locale. useyad-tools(1)to get a list of all possible languages.--bool-fmt=TYPEβ set the output type of boolean values toTYPE. possible types areT,t,Y,y,O,oand1.Tandtare for the true/false pair in the appropriate case.Yandyare for the yes/no pair in the appropriate case.Oandoare for the on/off pair in the appropriate case.1is for the 1/0 pair.--write-settingsβ write yad settings to a file. see the SETTINGS section.
π Custom about dialog options π
--pname=STRINGβ set the program name.--image=IMAGEβ set the program icon name.--pversion=STRINGβ set the program version string.--copyright=STRINGβ set the program copyright string.--comments=STRINGβ set the program detailed description.--license=STRINGβ set the program license. the value of this option can be one of the predefined licenses (GPL2,GPL3,LGPL2,LGPL3,BSD,MITorARTISTIC), a file name with license text, or an arbitrary string.--authors=STRINGβ set the list of program authors separated by comma.--website=URIβ set a link to the program website.--website-label=LABELβ set a label for the program 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 the chosen application. by default only the executable is shown. in extended form the output fields are name, display name, description, icon and executable.
additional argument for the application dialog is a mime-type. if the 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 it's%x. seestrftime(3)for more details.--show-weeksβ show the week numbers at the left side of the calendar.--details=FILENAMEβ read days description fromFILENAME.
the file with days details must be in the following format:
<date> <description>
the date field is a date in the format specified with the --date-format option. description is a string with date details, which may include Pango markup.
--select-action=COMMANDβ run the specified command on selecting a date. the selected date is added at the end of a command in the formYEAR MONTH DAY.
π¨ Color selection options π¨
--init-color=COLORβ sets the starting color value, so the dialog opens already showing the color you picked. π--gtk-paletteβ shows the system palette inside the color dialog. Heads up: on GTK+3 builds this option shows the palette instead of the color editor, okay? different vibe, still cute.--pickerβ adds a screen color picker button, so you can just go grab a color off your screen. obsessed. β¨--alphaβ adds opacity to the output color string. transparency slay.--palette=[FILENAME]β shows a palette and sets predefined colors from the filename you give it. If you don't give one,yaduses/etc/X11/rgb.txtby default. no cap.--expand-paletteβ the expander for the list of user-defined colors will be initially opened. so it starts unfolded, ready to go π«Ά--mode=MODEβ sets the output color mode. Possible values arehexorrgb, and the default ishex. HEX mode looks like#rrggbbaa, and RGB mode looks likergba(r, g, b, a). In RGBA mode opacity has values from0.0to1.0β literally decimals, not 0β255. π
π±οΈ Drag-and-Drop box options π±οΈ
--tooltipβ uses the dialog text as a tooltip for the Drag-and-Drop box. hover and learn, bestie.--command=CMDβ runs the command when data is received. Data strings pass to the command as an argument, or they replace the%smodifier in the command. By default the data just prints to stdout. simple as that.--exit-on-drop=NUMBERβ exits afterNUMBERdrops were reached. And0means an infinite number of drops β that's the default, so it just keeps going forever unless you say otherwise. π₯
β¨οΈ Text entry options β¨οΈ
--entry-label=STRINGβ sets the entry label text.--entry-text=STRINGβ sets the initial entry text, or the default item in a combo-box.--hide-textβ hides the entry text. secret entry energy π--completionβ uses completion instead of a combo-box.--complete=TYPEβ uses a specific type for extended completion.TYPEcan be:anyβ match any of the typed wordsallβ match all of the typed wordsregexβ when the typed text is treated as a regular expression
--editableβ allows making changes to the text in a combo-box. edit away π--numericβ uses a spin button instead of a text entry. Additional parameters on the command line are treated as minimum and maximum values, step value and precision (in that order). All these values are optional. The default range is from0to65535with step1. β--float-precision=NUMBERβ sets the precision of floating point numbers. By default precision is three digits after the point.--licon=IMAGEβ sets an icon on the left side of the entry. π--licon-action=CMDβ specifies a command which will be run when the left icon is clicked. The output of that command will be set as the entry text. iconic behavior tbh.--ricon=IMAGEβ sets an icon on the right side of the entry. matching set, we love it.--ricon-action=CMDβ specifies a command which will be run when the right icon is clicked. The output of the command will be set as the entry text.--num-outputβ outputs the index of the active element instead of the text, for a combo-box entry. numbers > words, iykyk.
Any extra data specified on the command line gets added as items of the combo-box entry β except in numeric mode, where that's not a thing.
If an icon is specified and no icon action is given, clicking the icon just clears the entry. And numeric fields will ignore the icons entirely. rip icons, you tried. π
πΌοΈ Iconbox options πΌοΈ
--read-dir=PATHβ reads.desktopfiles from the specified directory.--monitorβ watches for changes in the directory and automatically updates the content of the iconbox. live updates, we stay refreshed β¨--genericβ uses the fieldGenericNameinstead ofNamefor the shortcut label.--sort-by-nameβ uses the fieldNameinstead of the filename for sorting items.--descendβ sorts items in descending order. Note that if data is read from stdin, this option is useless without--sort-by-name. fr fr, don't skip it.--listenβ reads data from stdin. The data must be in order:Name,Tooltip,Icon,Command,InTerm, separated by newline.InTermis a case insensitive boolean constant (TRUEorFALSE). Sending a FormFeed character clears the iconbox. π--item-widthβ sets items width.--icon-sizeβ forces using the specified icon size. This option doesn't work in compact mode, just so you know. π--compactβ uses compact mode. Icon and name of each item is placed in a single row. tiny and tidy.--single-clickβ activates items by a single mouse click. Heads up: this option may not work properly in the case of compact mode. π--termβ pattern for terminal. By default it usesxterm -e %swhere%sis replaced by the command.
If both a directory and stdin are specified, the content of the iconbox will be read from the directory. directory wins, no debate. π
π File selection options π
--filename=FILENAMEβ sets the filename.--multipleβ allows selection of multiple filenames in the file selection dialog. more is more π--directoryβ activates directory-only selection.--saveβ activates save mode.--separator=STRINGβ specifies the separator character when returning multiple filenames.--confirm-overwrite=[TEXT]β confirms file selection if the filename already exists. The optional argument is a text for the confirmation dialog. protective queen behavior π«Ά--quoted-outputβ output values will be shell-style quoted.
π€ Font selection options π€
--fontname=FONTNAMEβ sets the initial font.FONTNAMEis a string with a font representation in the form"[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]". yes, all those brackets are part of the deal.--previewβ sets the preview text. so you can see the font before committing, cute.--separate-outputβ separates output of the selected font description.--separator=STRINGβ sets the output separator character. Default is|. πΈ--quoted-outputβ output data will be in shell-style quotes.
π Form options π
--field=LABEL[!TOOLTIP][:TYPE]β adds a field to the form.TYPEmay beH,RO,NUM,CHK,CB,CBE,CE,FL,SFL,DIR,CDIR,FN,MFL,MDIR,DT,SCL,SW,APP,ICON,CLR,BTN,FBTN,LINK,LBLorTXT. Let's break them down, bestie:Hβ hidden field type. All characters are displayed as the invisible char.ROβ the field is in read-only mode.NUMβ the field is a numeric. The initial value format for this field isVALUE[!RANGE[!STEP![PREC]]], whereRANGEmust be in the formMIN..MAX.!is a default item separator.PRECis a precision for decimals.CHKβ checkbox field. Initial value is a case insensitive boolean constant (TRUEorFALSE).CBβ combo-box field. Initial value is a listVAL1!VAL2!.... The separator is the same as in theNUMfield. A value started with^is treated as the default for the 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 creating a file.DIRβ directory selection button.CDIRβ field for creating a folder.FNβ font selection button. Initial value same as in the font dialog.MFLβ select multiple files. The value of this field is a list of files separated by the item separator.MDIRβ select multiple folders. The value of this field is a list of folders separated by the item separator.DTβ date field.SCLβ scale field. The value of this field is in a range0..100.SWβ switch field. Initial value is a case insensitive boolean constant (TRUEorFALSE).APPβ application selection button. The input value for this field is a mime-type. The output value is an executable for the selected application.ICONβ icon field. Like an average entry field but it has two icons. Left shows the current icon and right is clickable and callsyad-con-browserfor choosing an icon.CLRβ color selection button. Output values for this field are generated in the same manner as for the color dialog.BTNβ button field. The label may be in the formLABEL[!ICON[!TOOLTIP]]where!is an item separator.LABELis the text of the button label or a yad stock id.ICONis the button's icon (stock id or file name).TOOLTIPis an optional text for the popup help string. The initial value is a command which is run when the button is clicked. Special symbols%Nin the command are replaced by the value of fieldN. If the command starts with@, the output of the command will be parsed and lines started with a number and a colon will be treated as new field values. A quoting style for value whensh -cis used β a single quote around the command and double quotes around the-cargument. The specialquitcommand terminates the dialog in the usual way.FBTNβ same as button field, but with full relief of a button.LINKβ link button field.LBLβ text label. If the field name is empty, a horizontal separator line will be shown.TXTβ multiline text entry. This field always occupies all of the form width.
Without a type, the field will be a simple text entry. easy. β¨
--align=TYPEβ sets the alignment of field labels. Possible types areleft,centerorright. Default isleft.--columns=NUMBERβ sets the number of columns in the form. Fields will be placed from top to bottom.--separator=STRINGβ sets the output separator character. Default is|.--focus-field=NUMBERβ sets the focused field.--cycle-readβ cycled reading of stdin data. Sending a FormFeed character clears the form. This symbol may be sent asecho -e '\f'. π--align-buttonsβ aligns the label on button fields according to the--alignsettings.--item-separator=STRINGβ sets the separator character for combo-box or scale values. Default is!.--date-format=PATTERNβ sets the format for the date fields (same as in the calendar dialog).--float-precision=NUMBERβ sets the precision of floating point numbers. By default precision is three digits after the point.--complete=TYPEβ uses a specific type for extended completion.TYPEcan beanyfor matching any of the typed words,allfor matching all of the typed words, orregexwhen the typed text is treated as a regular expression.--scrollβ makes the form scrollable. for the long forms, we scroll π--homogeneousβ makes form fields' height and columns' width the same size. symmetrical slay.--changed-action=CMDβ runsCMDwhen aCHK,CB, orSWfield value is changed. The command runs with two arguments β the number of the changed field and its current value. The output of the command is parsed in the same manner as inBTNfields with the@prefix. Attention β this option may slow down your dialog. π you've been warned.--quoted-outputβ output values will be in shell-style quotes.--output-by-rowβ outputs field values row by row if several columns are specified.--num-outputβ outputs the index of the active element instead of the text, for combo-box fields.
because sometimes the form fields need a little pre-filled lore, bestie π
Any extra data you tack on the command line gets read as default values for the form fields. And ooh, a special value: @disabled@ makes the corresponding field inactive β like, it's there but it's not participating β¨
If you don't pass any extra arguments on the command line, the data gets read from stdin, one value per line. And "cycled reading" means that for N fields, the N+1th value will replace the first field β the cycle continues, no cap π Empty values get skipped when reading from stdin, so don't stress about blank lines.
π HTML OPTIONS π
--uri=URIβ opens the location you point at. URI can be a filename or an internet address. If the URI isn't an existing file and no protocol is specified, ahttp://prefix gets added to the URI for you, so generous π«Ά--browserβ turns on browser mode. In this mode every clicked link opens inside the html widget, and the command Open gets added to the context menu.--print-uriβ prints clicked links to standard output. By default, clicked links open withxdg-open.--mime=MIMEβ sets the mime type of the data passed to standard input to MIME. Default istext/html.--encoding=ENCODINGβ sets the encoding of the data passed to standard input to ENCODING. Default isUTF-8.--uri-handler=CMDβ sets an external handler for clicked URIs.%sgets replaced by the activated URI. The return code of the CMD must be0for keep working,1for ignoring the URI, and2for downloading the URI. This option only works in browser mode, iykyk. There are two environment variables available in the handler:YAD_HTML_BUTTONwith the value of the pressed mouse button, andYAD_HTML_STATEwith the value of a bitmask with the state of the modifier keys π₯--user-agent=STRINGβ sets the user agent string. Default isYAD-Webkit (@VERSION@).--user-style=STRINGβ loads custom custom user styles from a file or arbitrary data (yes, "custom custom," it said what it said π). STRING may be a path to a local file with CSS code or the CSS code itself.--disable-searchβ disables the search bar.--file-opβ enables file operations. This option adds an open menu item to the popup menu,--wk-prop=PROPβ sets an additional WebKit setting. This option may be used multiply times. Setting PROP must be in the form"setting-name value". The first character of the value must be a type identifier:bfor booleans,ifor integers, andsfor strings. The values themselves follow after a colon. List of possible settings can be found on this page βhttps://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.htmlπ
When the dialog works in browser mode, additional data on the command line is interpreted as a URI.
π LIST OPTIONS π
--column=STRING[:TYPE]β sets the column header. Types areTEXT,NUM,SZ,FLT,CHK,RD,BAR,IMG,HDorTIP.TEXTtype is default. UseNUMfor integers andFLTfor double values.TIPis used for defining a tooltip column.SZis a size column type β works exactly like aNUMcolumn but shows human readable sizes instead of numbers, aesthetic β¨CHK(checkboxes) andRD(radio toggle) are boolean columns.BARis a progress bar column β value must be between0and100, and if the value is outside the range it will be cropped to the nearest legal value.HDtype means a hidden column; such columns aren't displayed in the list, only in the output, sneaky πIMGmay be a path to an image or an icon name from the current GTK+ icon theme. Size of icons may be set in the gtk config file at theGTK_ICON_SIZE_MENUposition ofgtk-icon-sizes. Images specified by icon names will be scaled toGTK_ICON_SIZE_MENUuntil--force-icon-sizeis not sets. Image field prints as empty value.
Special column names @fore@, @back@ and @font@ set corresponding row attributes β and values of those columns don't show in results, they're just here for the vibes π¨
Column title can be specified in the form name!tooltip and Pango markup can be used in the name and tooltip parts. Slay.
--treeβ enables tree mode. In this mode extra data in the formROW_ID[:PARENT_ID]must be passed to yad before each row. See EXAMPLES for details π³--checklistβ uses check boxes for the first column. Outputs checked rows instead of selected rows. Disables multiple selection.--radiolistβ same as--checklistbut with a radio toggle for the first column.--separator=STRINGβ sets the output separator characters.--multipleβ allows multiple rows to be selected.--editableβ allows changes to text.--editable-cols=LISTβ sets the list of editable columns. LIST must be a string of numbers separated by commas.--no-headersβ does not show column headers.--no-clickβ disables sorting of column content by clicking on its header.--no-rules-hintβ doesn't draw even and odd rows in different colors. This option depends on your current gtk theme and may not work (rude, but ok π).--grid-lines=TYPEβ draws grid lines of type TYPE in the list dialog. TYPE can be one ofhor[izontal],vert[ical]orboth.--no-selectionβ disables selection in the list.--print-allβ prints all data from the list.--print-column=NUMBERβ specifies what column will be printed to standard output.0may be used to print all columns (this is the default).--hide-column=NUMBERβ hides a specific column.--expand-column=NUMBERβ sets the column expandable by default.0sets all columns expandable.--search-column=NUMBERβ sets the quick search column.0means to disable searching. By default search is made on the first column.--tooltip-column=NUMBERβ sets the column with popup tooltips.--sep-column=NUMBERβ sets the row separator column. If the cell value from this column equals the specified row separator value, that row will be drawn as a separator. Separator value must be set.--sep-value=TEXTβ sets the TEXT as a row separator value. This feature highly depends on your current GTK+ theme and may not work properly.--limit=NUMBERβ sets the number of rows in the list dialog. Only the last NUMBER rows will be shown. This option will take effect only when data is reading fromstdin.--wrap-width=NUMBERβ sets the width of a column before wrapping to NUMBER.--wrap-cols=LISTβ sets the list of wrapped columns. LIST must be a string of numbers separated by commas.--ellipsize=TYPEβ sets ellipsize mode for text columns. TYPE may beNONE,START,MIDDLEorEND.--ellipsize-cols=LISTβ sets the list of ellipsized columns. LIST must be a string of numbers separated by commas.--dclick-action=CMDβ sets the CMD as a double-click command. When the user double-clicks on a row, CMD will be launched with values of all columns as arguments. By default, double-click selects the row and acts as an OK button for simple lists, sets the checkbox if--checklistis specified, and does nothing when the list runs with--multipleoption. When double-click is specified, Enter acts as a double-click and Ctrl+Enter acts as an OK button. CMD may contain a special character%sfor 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 the current row β main character energy, honestly π This option doesn't work with--editable.--select-action=CMDβ sets the CMD as an action when selection is changed. CMD will be launched with values of all columns as arguments. CMD may contain a special character%sfor 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β sets the CMD as an action when the row is added, modified or removed. The first argument for the command is the name of the action (add,editordel). The rest of the command line is data from the selected row. Output of this command sets the new row values.--tree-expandedβ expands all tree nodes at startup.--regex-searchβ uses regular expressions in search for text fields.--listenβ listens for data fromstdineven if command-line values were specified.--quoted-outputβ output values will be shell-style quoted.--float-precision=NUMBERβ sets precision of floating point numbers. By default precision is three digits after the point.--add-on-topβ adds new records at the top of the list.--tail,--auto-scrollβ autoscrolls to the end of the list when a new row is added.--iec-formatβ uses IEC (base 1024) units for size values. With this option, values will have suffixesKiB,MiB,GiBπ--simple-tipsβ doesn't use markup in tooltips even if the text has valid markup.--header-tipsβ uses the header name as a fallback tooltip text.--column-align=STRINGβ sets alignment for columns. STRING must contain an array of lettersl,rorcfor left, center or right alignment of column content.--header-align=STRINGβ sets alignment for column headers. STRING same as in--column-align.
Sending the FormFeed character to the list clears it. This symbol may be sent as echo -e '\f' β¨
π NOTEBOOK OPTIONS π
--key=KEYβ sets the key of the children.--tab=TEXTβ adds a tab with the specified label to the notebook. TEXT may be in the formLABEL[!ICON[!TOOLTIP]]where!is an item separator. For stack mode, TEXT for label is used as is.--tab-pos=TYPEβ sets the tabs position. Value may betop,bottom,left, orright. Default istop. For stack mode, onlytoporbottompositions are available.--tab-borders=NUMBERβ sets the border width around the widget in tabs.--active-tab=NUMBERβ sets the active tab.--expandβ expands all tabs to the full width of a dialog window.--stackβ uses stack mode (GtkStackinstead ofGtkNotebook).
See the NOTEBOOK and PANED section for more about the notebook dialog π«Ά
π NOTIFICATION OPTIONS π
--command=CMDβ sets the command running when clicked on the icon. Default action is quit if--listenisn't specified.--listenβ listens for commands onstdin. See the NOTIFICATION section.--menu=STRINGβ sets the initial menu for right-click.--separator=STRINGβ sets the separator character for menu values. Default is|.--item-separator=STRINGβ sets the separator character for menu items. Default is!.--no-middleβ disables exit on middle click.--hiddenβ doesn't show the icon at startup.--icon-size=SIZEβ Sets the notification icon size toSIZE. Heads up: this one doesn't work for themed icons, bestie.
See the NOTIFICATION section for more about separators.
π§ Appindicator options
--listenβ Listens for commands on stdin. Peep the NOTIFICATION section for the deets.--menu=STRINGβ Sets the initial menu for right-click. Very right-click slay.--separator=STRINGβ Sets the separator character for menu values. Default is|.--item-separator=STRINGβ Sets the separator character for menu items. Default is!.--hiddenβ Doesn't show the icon at startup. Mysterious. Iconic. Incognito vibes.
π¦ Paned options
--key=KEYβ Sets the key of the children.--orient=TYPEβ Sets the orientation of panes inside the dialog.TYPEmay behor[izontal]orvert[ical].--splitter=POSβ Sets the initial splitter position.--focused=PANEβ Sets the pane for initial focus.PANEmust be1or2. Default is1.
See the NOTEBOOK and PANED section for more about the paned dialog.
πΈ Picture options
--size=VALUEβ Sets the initial size of the picture. Available values arefitfor fitting the image in the window, ororigfor showing the picture in original size.--inc=NUMBERβ Sets the increment value for scaling the image.--filename=FILENAMEβ Sets the picture filename. If no filename is specified, extra data will be used. In that case, several filenames can be specified.--file-opβ Enables file operations. This option adds an open menu item to the popup menu.--image-changed=CMDβ Sets the command that runs after changing the image. The argument of the command is the filename of the current image. The argument can be specified by the'%s'pattern, or it will be the last part of the command.
Some actions on a picture β like navigation, scaling, or rotating β are available from the popup menu. Those actions can be made only on static images. No moving-picture chaos allowed.
π Popup options
--transparent=PERCENTβ Makes the popup window transparent.--timeout=TIMEOUTβ Changes the default timeout. By default, timeout is300seconds.--keepβ Don't close the popup window automatically. By default, the window will be closed afterTIMEOUTseconds.--align=TYPEβ Sets the alignment of the popup title and text.TYPEcan be one ofleft,center, orright.
π¨οΈ Print options
--type=TYPEβ Sets the source file type.TYPEmay beTEXTfor text files,IMAGEfor image files, orRAWfor files in postscript or pdf formats.--filename=FILENAMEβ Sets the name or path to the source file.--headersβ Adds headers to the top of the page with filename and page number. This option doesn't work forRAWtype.--add-previewβ Adds a Preview button to the print dialog. This option doesn't work forRAWtype.--fontname=FONTNAMEβ Sets the font for printing text.FONTNAMEis a string with font representation in the form"[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]". This option works only forTEXTtype.
π 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 are treated like percentages for the progress bar.
--bar=LABEL[:TYPE]β Adds a progress bar.LABELis a text label for the progress bar.TYPEis a progress bar type. Types are:NORMfor normal progress bar,RTLfor inverted progress bar,PULSEfor pulsate progress bar, andCPULSEfor continuous pulsating progress bar. If no bars are specified, the progress dialog works in single-bar mode.--verticalβ Sets vertical orientation of progress bars.--align=TYPEβ Sets alignment of bar labels. Possible types areleft,center, orright. Default isleft.--progress-text=TEXTβ Sets the label of the progress bar toTEXT. This option works only in single-bar mode.--hide-textβ Hides text in progress bars.--rtlβ Sets Right-To-Left progress bar direction. This option works only in single-bar mode.--auto-closeβ Closes the dialog when100%has been reached.--auto-killβ Kills the parent process if the cancel button is pressed.--pulsateβ Pulsates the progress bar. This option works only in single-bar mode.--continuousβ Continuously pulsating progress bar. This option works only in single-bar mode.--scrollβ Makes the layout scrollable.--enable-log[=TEXT]β Shows the log window. This window gathers all of the lines from stdin that start with#, instead of setting the appropriate progress text. Optional argumentTEXTis a text label for the window expander.--log-on-topβ Places the log window above progress bars.--log-expandedβ Starts with the log window expanded.--log-heightβ Sets the height of the log window.
Initial values for bars are set as extra arguments. Each line with progress data passed to stdin must start with N:, where N is the number of the progress bar. In single-bar mode, N: is not needed. Easy peasy.
π Text info options
--filename=FILENAMEβ Opens the specified file.--editableβ Allows changes to the text.--wrapβ Enables text wrapping.--formattedβ Enables Pango markup. This option doesn't work with the--editableoption.--justify=TYPEβ Sets justification.TYPEmay beleft,right,center, orfill. Default isleft.--margins=NUMBERβ Sets text margins toNUMBER.--tail|--auto-scrollβ Autoscrolls to the end when new text appears. This option works only when text is read from stdin.--line=NUMBERβ Jumps to a specific line at startup. This option works only when a filename was specified.--show-cursorβ Shows the cursor in read-only mode.--show-uriβ Makes links in the text clickable. Links open with thexdg-opencommand.--fore=COLORβ Sets the default color for text.--back=COLORβ Sets the default color for the background.--uri-color=COLORβ Sets the color for links. Default isblue.--listenβ Listens for data from stdin even if a filename was specified.--in-placeβ Saves the file on exit instead of printing its content on stdout. This option works only if the file was specified from the command line.--file-opβ Enables file operations. This option adds open and save menu items to the popup menu. This option works only in editable mode.--disable-searchβ Disables the search bar.--confirm-save=[TEXT]β Confirms file saving if the file content was changed. This option works only when--in-placeis specified. The optional argument is text for the confirmation dialog.
Next options work only if yad is built with GtkSourceView:
--lang=LANGUAGEβ Highlights syntax for the specifiedLANGUAGE.--theme=THEMEβ Sets the used theme toTHEME. Useyad-tools(1)to get a list of all available themes.--mime=TYPEβ Specifies the mime type of input data. This option is only needed for guessing appropriate syntax highlighting.--line-numβ Shows line numbers.--line-hlβ Highlights the current line.--line-marksβ Enables line marks mode. There are two types of marks. The first type is set by the left mouse button, and the second by the right mouse button.--mark1-color=COLORβ Sets the background color for marks of the first type toCOLOR. Default islightgreen.--mark2-color=COLORβ Sets the background color for marks of the second type toCOLOR. Default ispink.--right-margin=[POS]β Enables the mark of the right margin. Optional argumentPOSis a margin position in characters. Default is80.--bracketsβ Highlights matching brackets.--indentβ Enables autoindent. This option also sets the Tab key as the indent key.--smart-he=TYPEβ Sets behavior of Home and End keys. TheTYPEis one ofnewer,before,after, oralways.--smart-bsβ Enables smart mode for BackSpace. If this option is enabled, BackSpace will delete spaces to the next tab position.--tab-widthβ Sets the tabulation step.--indent-widthβ Sets the indentation step.--spacesβ Inserts spaces instead of tabulation.
If the fontname option is specified for the text dialog, the description of the font must be in CSS style (not in a Pango style). Sending a FormFeed character to the text dialog clears it. This symbol may be sent as echo -e '\f'. Pressing Ctrl+S popups the search entry in the text dialog. Muscle memory, but make it text editor.
βοΈ Scale options
--value=VALUEβ Sets the initial value.--min-value=VALUEβ Sets the minimum value.--max-value=VALUEβ Sets the maximum value.--step=VALUEβ Sets the step size.--enforce-stepβ Only allows values in step increments.--page=VALUEβ Sets the paging size. By default, the page value isSTEP*10.--print-partialβ Prints partial values.--hide-valueβ Hides the value.--verticalβ Shows a vertical scale.--invertβ Inverts the scale direction.--inc-buttonsβ Shows buttons on the edges of a scale for increasing or decreasing the scale value.--mark=[NAME]:VALUEβ Adds a mark to the scale. May be used multiple times.NAMEis an optional argument for setting a label to the mark.
ποΈ File filters options
--file-filter=NAME | PATTERN1 PATTERN2 ...β Adds a filename filter.NAMEis a displayed filter name, andPATTERNis a shell-style filename pattern (for example*.txt). This option may be used multiple times.--mime-filter=NAME | MIME1 MIME2 ...β Adds a mime-type filter.NAMEis a displayed filter name, andPATTERNis the name of a mime type (for exampletext/plain). This option may be used multiple times.--image-filter=[NAME]β Adds a filter for images supported by the gdk-pixbuf library.NAMEis the optional name for this filter.
These options apply to all of yad's file chooser dialogs. Every single one. No filter-less behavior on my watch.
πΌοΈ File preview options
--add-previewβ Adds a preview widget. Preview images load from normal (default) or large thumbnails according to the XDG Thumbnails specification v0.8.0 (http://standards.freedesktop.org/thumbnail-spec/latest/), or yad creates them for image files and saves them as normal or large thumbnails.--large-previewβ Uses large previews by default. This option can be permanently turned on through yad settings.
These options apply to all of yad's file chooser dialogs.
NOTE: YAD doesn't check mtime for thumbnailed images and doesn't update the preview if the original file was changed after the thumbnail was created. Bestie, the thumbnail can be lying to you.
π Miscellaneous options π
-?,--helpβ shows a lil summary of all the options, bestie π--aboutβ pops open an about dialog, very meta--versionβ shows the version of the program, so you know what you're working with β¨
Also, no cap, the standard GTK+ options are accepted too.
π NOTEBOOK and PANED πͺ
Okay so Notebook is this complex dialog that literally swallows other dialogs into its tabs β it's giving main character energy fr. Dialogs get identified by a unique key (an integer, keep it cute) and must be run in that special plug mode (the --plug option).
Here's the iconic example: a notebook dialog with two tabs, where the first has a simple text and the 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! π Do not come for me about the ordering, it's not me it's the tabs.
Paned works in the same manner as a notebook with one restriction β only the first and second plug dialogs will be swallowed into panes. That's it, that's the whole vibe check.
π NOTIFICATION π
This lets commands be sent to yad in the form command:args. The possible commands are icon, tooltip, visible, action, menu and quit. Slay, let's go through them π
icon:ICONNAMEβ sets the notification icon to ICONNAME.tooltip:STRINGβ sets the notification tooltip.visible:[true|false]β sets the notification icon to visible or invisible state. Peekaboo π«£action:COMMANDβ specifies the command that runs when you click on the icon. There are two special commands here:menufor popup user defined menu, andquitfor exiting the program.menu:STRINGβ sets the popup menu for the notification icon. STRING must be in the formname1[!action1[!icon1]]|name2[!action2[!icon2]]....An empty name adds a separator to the menu. The separator character for values (e.g.|) is set with the--separatorargument. The separator character for menu items (e.g.!) is set with the--item-separatorargument.quitβ exits the program. Middle clicking on the icon also sends the quit command. iykyk π±οΈ
π STOCK ITEMS π
This is the list of predefined items available in yad β genuinely iconic lineup:
yad-aboutβ label About, iconhelp-aboutyad-addβ label Add, iconlist-addyad-applyβ label Apply, icongtk-applyyad-cancelβ label Cancel, icongtk-cancelyad-clearβ label Clear, icondocument-clearyad-closeβ label Close, iconwindow-closeyad-editβ label Edit, icongtk-edityad-executeβ label Execute, iconsystem-runyad-noβ label No, icongtk-noyad-okβ label OK, icongtk-okyad-openβ label Open, icondocument-openyad-printβ label Print, icondocument-printyad-quitβ label Quit, iconapplication-exityad-refreshβ label Refresh, iconview-refreshyad-removeβ label Remove, iconlist-removeyad-saveβ label Save, icondocument-saveyad-searchβ label Search, iconsystem-searchyad-sendβ label Send, icondocument-sendyad-settingsβ label Settings, icongtk-preferencesyad-yesβ label Yes, icongtk-yes
π ENVIRONMENT VARIABLES π
YAD_OPTIONSβ this variable can hold some default options for yad. All options in this variable may be redefined from the command line. So the CLI stays the boss, periodt πYAD_SETTINGS_FILEβ the location of the file with yad settings. See the SETTINGS section for the details.YAD_PIDβ this variable gets set to the value of the current dialog's pid, and it's accessible in all dialog children.YAD_XIDβ this variable gets set to the value of the current dialog's X Window ID, and it's accessible in all dialog children. > Heads up bestie: this variable is not set in print and notification dialogs, and not in dialogs which act as notebook or paned children. π«Ά
π USER DEFINED SIGNALS π
SIGUSR1β closes the dialog with a0exit code.SIGUSR2β closes the dialog with a1exit code.
Send the right signal, get the right exit code. Fr fr π₯
πͺ EXIT STATUS πͺ
0β the user has pressed the OK button1β the user has pressed the Cancel button70β the dialog has been closed because the timeout has been reached.252β the dialog has been closed by pressing Esc or by using the window functions to close the dialog
Exit codes for user-specified buttons must be specified in the command line. An even exit code means to print the result, an odd one just returns the exit code. That's the whole rule, no cap β¨
π WIDGETS NAMES π
The look and feel of yad's dialogs can be customized through a gtkrc file. Here are the names of yad's widgets β every single one, I'm not skipping anybody π
yad-dialog-windowβGtkDialogβ Dialog windowyad-dialog-imageβGtkImageβ Dialog imageyad-dialog-labelβGtkLabelβ Dialog textyad-app-widgetβGtkAppChooserWidgetβ Application selection widgetyad-calendar-widgetβGtkCalendarβ Calendar widgetyad-color-widgetβGtkColorChooserβ Color selection widgetyad-color-paletteβGtkTreeViewβ Predefined colors listyad-entry-labelβGtkLabelβ Entry labelyad-entry-widgetβGtkEntryβ Entry widgetyad-entry-spinβGtkSpinButtonβ Entry widget for numeric valuesyad-entry-comboβGtkComboBoxβ Entry widget with comboyad-entry-edit-comboβGtkComboBoxEntryβ Entry widget with editable comboyad-file-widgetβGtkFileChooserβ File selection widgetyad-font-widgetβGtkFontChooserβ Font selection widgetyad-form-flabelβGtkLabelβ Field label in formyad-form-buttonβGtkButtonβ Button field in formyad-form-entryβGtkEntrfyβ Entry field in formyad-form-spinβGtkSpinButtonβ Numeric entry field in formyad-form-checkβGtkCheckButtonβ Checkbox field in formyad-form-comboβGtkComboBoxβ Combo field in formyad-form-edit-comboβGtkComboBoxEntryβ Editable combo field in formyad-form-linkβGtkLinkButtonβ Link field in formyad-form-fileβGtkFileChooserButtonβ File or directory field in formyad-form-fontβGtkFontChooserButtonβ Font field in formyad-form-appβGtkAppChooserButtonβ Application field in formyad-form-switchβGtkSwitchβ Switch field in formyad-form-colorβGtkColorChooserButtonβ Color field in formyad-form-labelβGtkLabelβ Label field in formyad-form-scaleβGtkScaleβ Scale widget in formyad-form-separatorβGtkSeparatorβ Separator in formyad-form-textβGtkTextViewβ Multiline text field in formyad-icons-fullβGtkIconViewβ Icons widget for normal modeyad-icons-compactβGtkTreeViewβ Icons widget for compact modeyad-list-widgetβGtkTreeViewβ List widgetyad-notebook-widgetβGtkNotebookβ Notebook widgetyad-paned-widgetβGtkPanedβ Horizontal or vertical pane widgetyad-progress-widgetβGtkProgressBarβ Progressbar widgetyad-scale-widgetβGtkScaleβ Scale widgetyad-stack-widgetβGtkStackβ Stack widgetyad-stack-switcher-widgetβGtkStackSwitcherβ Stack switcher widgetyad-text-widgetβGtkTextViewβ Text info widgetyad-timeout-indicatorβGtkProgreeBarβ Timeout indicator
(Yes, GtkEntrfy and GtkProgreeBar are written exactly like that in the list. Copy them as-is if you're matching against them, bestie β do not "fix" them π)
βοΈ SETTINGS βοΈ
YAD reads some defaults from a settings file. This file may be created with the --write-settings argument. The syntax of this file is a simple ini-style. Default location is $XDG_CONFIG_HOME/yad/settings.conf, and it can be redefined with the YAD_SETTINGS_FILE environment variable. Easy π
β¨ EXAMPLES β¨
Okay these are the fun ones, let's go π¦
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. Not me making the whole thing a threat π
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
(Popato stays a popato. It's in the original, I don't make the rules π₯π )
π DEVELOPMENT π
There are some developers features provided with YAD β for the build girlies π§
YAD icon browser is a graphical tool for discovering icons in the current or a user-specified GTK+ icon theme. Launch it as:
yad-icon-browser [theme]
When using autoconf you may use the special m4 macro AM_PATH_YAD for looking for yad and checking its 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. Absolute legends, we stan ππ
π SEE ALSO π
okay so you've absorbed the whole entire manual (iconic of you, fr) β here's the rest of the friend group, the other pages you might wanna go read next bestie π
gdialog(1)β the other dialog-flavoured cousin, go say hi π«Άdialog(1)β like, the original OG terminal-dialog situation, the blueprint, the blueprint-est πzenity(1)β the other GUI-dialog girlie, you know the one, we don't compete we just coexist β¨yad-tools(1)β the companion page for theyad-toolsstuff, highkey go check it out π
not to be dramatic but you literally read the whole page and that's main character energy, no cap π
and that's a wrap on the whole thing, bestie π¦ this page came from the yad source, dated June 2024, and it lives in section YAD(1) of the manual β so like, that's its whole little home π π you're so welcome, go make some gorgeous dialogs, slay, periodt πΈπ
π¦ where this page comes from
- arch rolling: yad 15.0-2 Β· GPL-3.0-or-later
- nixpkgs unstable: yad 15.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms