In Bash if I want to get a list of all available keyboard layouts but prepend my own keyboard layouts I can do:
readarray -t layouts < <(localectl list-x11-keymap-layouts)
layouts=("custom1" "custom2" "${kb_layouts[@]}")
If I want to append I can do:
readarray -t layouts < <(localectl list-x11-keymap-layouts)
layouts=("${kb_layouts[@]}" "custom1" "custom2")
Is it possible to achieve the same in a single line, in the readarray
command?