Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show text in bash/dialogue

Tags:

bash

how can I display the text "Selected Item x" to like in the picture?

enter image description here

           ITM=$(dialog --stdout --menu "\nSelect Items...\n " 20 120 0 \
                \
                "item_1" "Item 1" \
                "item_2" "Item 2" \
                "item_3" "Item 3")
like image 274
Charlie Avatar asked Apr 15 '26 14:04

Charlie


1 Answers

This seems to be one step further

#!/usr/bin/env bash
items=(
    item_1 "Item 1" "Selected Item 1"
    item_2 "Item 2" "Selected Item 2"
    item_3 "Item 3" "Selected Item 3"
)

dialog --item-help --menu '\nSelected Items...\n' 20 120 0 "${items[@]}"

It doesn't look like dialog(1) allows you to position the help text though.

like image 187
geirha Avatar answered Apr 17 '26 10:04

geirha