Search code examples
bashzenityyad

Bash yad ComboBox argument as an array


Does yad support an array sent as an argument to the ComboBox field?

Example:

yad --form --field="ComboBox:CB" One\!Two\!Three

Can I make it work with an array?

array=(one two three)
yad --form --field="ComboBox:CB" $array

Solution

  • yad does not support array as input for ComboBox natively. You'll have to convert your array to a ! separated string.

    You can do this by temporarily modifying your IFS variable, like so :

    array=(one two three)
    yad --form --field="ComboBox:CB" $(IFS=! ; echo "${array[*]}")