-
yad > les listes
yad --checklist
Exemple avec une liste de courses :
Créer un fichier
/root/shopping.listavec, à l’intérieur :true milk false bread false eggs false butter false tomato soup false flour false steak false sausages false carrots true beans
Here is the yad program that reads the file and lets you select the items.
yad --height=300 --list --checklist --column=Buy --column=Item < /root/shopping.list
--no-headersPour ne pas afficher le titre des colonnes.Il est obligatoire d’utiliser --column avec --list . Cependant, pour ne pas afficher le nom des colonnes :
yad --list --no-headers --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69
--column=COLUMNNom de la colonne--column=COLUMN:TYPENom et Type de la colonne (TEXT, NUM, FLT, CHK, IMG or TIP)TYPE peut être :
TEXTtype is default (default)
NUMfor integers
FLTfor double values
CHKcheckboxes are a boolean columns
RDradio toggle are a boolean columns
IMGmay be path to image or icon name from currnet GTK+ icon theme. Size of icons may be set in config file
HDtype means a hidden column. Such columns are not displayes in the list, only in output
TIPis used for define tooltip columnyad --list --column=Age:num --column=Select:chk --column=Comment:text 22 true Good
--checklistUse check boxes for first columnyad --checklist --list --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69
--separator=SEPARATORSet output separator character. The default is "|"yad --checklist --list --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69
When you select Richard and click on
OK, this is the output you get :TRUE|Richard|Dick|69
Now if you add
--separator=,to the command list :yad --checklist --list --separator=, --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69
Your output is :
TRUE,Richard,Dick,69,
--multipleAllow multiple rows to be selectedyad --list --multiple --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69
You do need to hold the shift or Ctrl key when selecting the row.
--editableAllow changes to text.yad --list --editable --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69
You can edit each of the fields. When you click on
OKthe changes will be parsed :Richard|George|69|
--print-allPrint all data from list. will parse all rows although I have only selected one.yad --list --print-all --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69
William|Bill|40|
Richard|Dick|69|
--ellipsize=TYPESet ellipsize mode for text columns (TYPE - NONE, START, MIDDLE or END)yad --list --ellipsize=end --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69
--print-column=NUMBERPrint a specific column.By default or if 0 is specified will be printed all columns
--hide-column=NUMBERHide a specific column--expand-column=NUMBERSet the column expandable by default. 0 sets all columns expandable--search-column=NUMBERSet the quick search column. Default is first column.Set it to 0 for disable searching --limit=NUMBER Set the limit of rows in list
--dclick-action=CMDSet double-click action.This command will allow you to double click on a list item and have it perform an action.
yad --width=300 --height=200 --separator=" " --list --dclick-action="viewnior" \ --column=Name \ /root/0-test/work/image-1.png \ /root/0-test/work/image-2.png \ /root/0-test/work/image-3.png \ /root/0-test/work/image-4.png
Output:
/root/0-test/work/image-3.png--regex-searchUse regex in searchNotification icon options
--command=CMDSet left-click action--listenListen for commands on stdin--separator=SEPARATORSet separator character for menu values--item-separator=SEPARATORSet separator character for menu items--column=STRING[:TYPE]Set the column header. Types areTEXT,NUM,SZ,FLT,CHK,RD,BAR,IMG,HDorTIP.TEXTtype is default. UseNUMfor integers andFLTfor double values.TIPis used for define tooltip column.SZsize column type. Works exactly likeNUMcolumn but shows human readable sizes instead of numbers.CHK(checkboxes) andRD(radio toggle) are a boolean columns.BARis a progress bar column. Value must be between0and100. If value is outside is range it will be croped to neares legal value.HDtype means a hidden column. Such columns are not displayes in the list, only in output.IMGmay 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. 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.--checklistUse check boxes for first column.--radiolistUse radio toggle for first column.--separator=STRINGSet output separator characters.--multipleAllow multiple rows to be selected.--editableAllow changes to text.--editable-cols=LISTSet the list of editable columns.LISTmust be a string of numbers separated by comma.--no-headersDo not show column headers.--no-clickDisable sorting of column content by clicking on its header.--no-rules-hintDon’t draw even and odd rows by a different colors. This option depends on your current gtk theme and may not work.--grid-lines=TYPEDraw grid lines of typeTYPEin list dialog.TYPEcan be one of thehor[izontal],vert[ical]ofboth.--no-selectionDisable selection in list.--print-allPrint all data from the list.--print-column=NUMBERSpecify what column will be printed to standard output.0may be used to print all columns (this is default).--hide-column=NUMBERHide a specific column.--expand-column=NUMBERSet the column expandable by default.0sets all columns expandable.--search-column=NUMBERSet the quick search column.0mean to disable searching. By default search mades on first column.--tooltip-column=NUMBERSet the column with popup tooltips.--sep-column=NUMBERSet 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=TEXTSet theTEXTas a row separator value. This feature highly depends on your current GTK+ theme and may not work properly.--limit=NUMBERSet the number of rows in list dialog. Will be shown only the lastNUMBERrows. This option will take effect only when data reading from stdin.--wrap-width=NUMBERSet the width of column before wrapping toNUMBER.--wrap-cols=LISTSet the list of wrapped columns.LISTmust be a string of numbers separated by comma.--ellipsize=TYPESet ellipsize mode for text columns.TYPEmay beNONE,START,MIDDLEorEND.--ellipsize-cols=LISTSet the list of ellipsized columns.LISTmust be a string of numbers separated by comma.--dclick-action=CMDSet theCMDas a double-click command. When user double-clicked on row,CMDwill be launched with values of all columns as an arguments. By default double-click selects row and act asOKbutton for simple lists, set the checkbox if--checklistspecified and do nothing when list run with--multipleoption. When double-click specifiedEnteracts as a double-click andCtrl+Enteracts as anOKbutton.CMDmay contain a special character `%s’ for setting a position for arguments. By default arguments will be concatenated to the end ofCMD. IfCMDstarts with@, its output will replace values of current row. This option doesn’t work with--editable.--select-action=CMDSet theCMDas a action when selection is changed.CMDwill be launched with values of all columns as an arguments.CMDmay contain a special character `%s’ for setting a position for arguments. By default arguments will be concatenated to the end ofCMD. This option doesn’t work with--multiple.--add-action=CMDSet theCMDas a action when new row is added from a context menu. Command launched without any additional arguments. Output of this command sets the new row values.--regex-searchUse regular expressions in search for text fields.--listenListen data from stdin even if command-line values was specified.--quoted-outputOutput values will be shell-style quoted.--float-precision=NUMBERSet precision of floating point numbers. By default precision is three digits after point. Sending FormFeed character to list clears it. This symbol may be sent asecho -e ‘\f’.