• yad > les listes

      yad --checklist

       

      Exemple avec une liste de courses :

       

      Créer un fichier /root/shopping.list avec, à 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-headers Pour 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=COLUMN Nom de la colonne

       

      --column=COLUMN:TYPE Nom et Type de la colonne (TEXT, NUM, FLT, CHK, IMG or TIP)

      TYPE peut être :

       

      TEXT type is default (default)
      NUM for integers
      FLT for double values
      CHK checkboxes are a boolean columns
      RD radio toggle are a boolean columns
      IMG may be path to image or icon name from currnet GTK+ icon theme. Size of icons may be set in config file
      HD type means a hidden column. Such columns are not displayes in the list, only in output
      TIP is used for define tooltip column

       

      yad --list --column=Age:num --column=Select:chk --column=Comment:text 22 true Good


       

      --checklist Use check boxes for first column

       

      yad --checklist --list --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69


       

      --separator=SEPARATOR Set 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,


      --multiple Allow multiple rows to be selected

       

      yad --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.

       

       

      --editable Allow 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 OK the changes will be parsed : Richard|George|69|


      --print-all Print 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=TYPE Set 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=NUMBER Print a specific column.

       

      By default or if 0 is specified will be printed all columns

       

      --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. Default is first column.

      Set it to 0 for disable searching --limit=NUMBER Set the limit of rows in list

       

      --dclick-action=CMD Set 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-search Use regex in search

      Notification icon options

      --command=CMD Set left-click action

      --listen Listen for commands on stdin

      --separator=SEPARATOR Set separator character for menu values

      --item-separator=SEPARATOR Set separator character for menu items

       

       

       

       

      --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. 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.

      --checklist Use check boxes for first column.

      --radiolist Use radio toggle for 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.

      --add-action=CMD Set the CMD as 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-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. Sending FormFeed character to list clears it. This symbol may be sent as echo -e ‘\f’.

       

       

       

 

Aucun commentaire

 

Laissez un commentaire