shellcommand-linedialogmodal-dialogcancel-button

How can I generate an OK/Cancel box with the dialog command?


I want to generate the graphic below, from the (Linux) command-line.

I can get pretty close to that by invoking:

dialog --title "fsfe.org" --msgbox  "This computer\nis not old,\nit is sustainable" 10 22

But that only gives me an OK button; I need OK/Cancel. Can I do that with the dialog program?

enter image description here


Solution

  • You can do it also in dialog:

    enter image description here

    You need to add an extra button to the box.

    $ dialog \
            --ok-label 'OK' \
            --extra-button --extra-label 'Cancel' \
            --title 'fsfe.org' \
            --msgbox 'This computer\nis not old,\nit is sustainable' \
            8 30