How to create a message box from the command line?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
45
down vote

favorite
21












Either GUI message boxes, or message boxes that show inside the terminal.



It would also be interesting to be able to get simple input back from the user, e.g. yes / no or radio buttons.










share|improve this question



















  • 7




    What do you mean by "message box"? A graphic alert box, a popup message box? Something else?
    – polym
    Jul 16 '14 at 18:44















up vote
45
down vote

favorite
21












Either GUI message boxes, or message boxes that show inside the terminal.



It would also be interesting to be able to get simple input back from the user, e.g. yes / no or radio buttons.










share|improve this question



















  • 7




    What do you mean by "message box"? A graphic alert box, a popup message box? Something else?
    – polym
    Jul 16 '14 at 18:44













up vote
45
down vote

favorite
21









up vote
45
down vote

favorite
21






21





Either GUI message boxes, or message boxes that show inside the terminal.



It would also be interesting to be able to get simple input back from the user, e.g. yes / no or radio buttons.










share|improve this question















Either GUI message boxes, or message boxes that show inside the terminal.



It would also be interesting to be able to get simple input back from the user, e.g. yes / no or radio buttons.







command-line






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 8:45









Ciro Santilli 新疆改造中心 六四事件 法轮功

4,64824038




4,64824038










asked Jul 16 '14 at 18:41









user62511

70231529




70231529







  • 7




    What do you mean by "message box"? A graphic alert box, a popup message box? Something else?
    – polym
    Jul 16 '14 at 18:44













  • 7




    What do you mean by "message box"? A graphic alert box, a popup message box? Something else?
    – polym
    Jul 16 '14 at 18:44








7




7




What do you mean by "message box"? A graphic alert box, a popup message box? Something else?
– polym
Jul 16 '14 at 18:44





What do you mean by "message box"? A graphic alert box, a popup message box? Something else?
– polym
Jul 16 '14 at 18:44











4 Answers
4






active

oldest

votes

















up vote
86
down vote



accepted










For a standard "box around a message", use boxes:



echo 'This is a test' | boxes


boxes will look like this (First one. Second one is a custom like cowsay):



Screenshot of an asterix box and an ASCII-art dog holding a sign of text




If you mean an alert box, use notify-send:



notify-send 'title' 'message'


notify-send looks like this:



Pop-up message reading "Hello Ashframe..."




You also can use zenity for a popup window:



zenity --error --text="An error occurred!" --title="Warning!"


Zenity is more graphical and has more options, like having the window appear as a question, using:



zenity --question --text="Do you wish to continue/?"


or even progress bars, using:



find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."


zenity looks like this:



error, question, info, and warning dialog boxes with buttons




Or use dialog, for a command-line only message box:



dialog --checklist "Choose OS:" 15 40 5 
1 Linux off
2 Solaris on
3 'HP UX' off
4 AIX off


dialog looks like this:



dialog TUI with 4 options




Another option is whiptail:



whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78


whiptail looks like this:



whiptail pop-up box with two text buttons




And if you are truly crazy, use toilet:



toilet -F border -F gay "CRAZY"


toilet looks like this:



colorful text box reading "CRAZY"



  • Source for boxes

  • Source for dialog 1

  • Source for dialog 2

  • Source for zenity 1

  • Source for zenity 2

  • Source for whiptail 1

  • Source for whiptail 2

  • Source for toilet





share|improve this answer


















  • 2




    Really complete answer, it's useful! Thank you!
    – JBFWP286
    Mar 21 '17 at 0:46

















up vote
17
down vote













xmessage



This is the granddaddy of GUI alerts:



xmessage -center "Hello, World!"




Pure retro goodness.



I also bet that it should be widely available on X11 systems.



SO thread: How to show a GUI message box from a bash script in linux? | Stack Overflow



Tested in Ubuntu 18.04.






share|improve this answer





























    up vote
    7
    down vote













    And then just because @polym's completely over the top answer missed the classic messaging:



    write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with echo "message" | write username



    write




    And the complement to write, wall to send a message to all users



    wall






    share|improve this answer



























      up vote
      0
      down vote













      If you are willing to pipe the text to a Python wrapper, you can use terminaltables:



      pip3 install colorclass
      pip3 install terminaltables


      Then in the GitHub Repo, you can use one of the examples to write a python wrapper.



      enter image description here






      share|improve this answer




















        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f144924%2fhow-to-create-a-message-box-from-the-command-line%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        86
        down vote



        accepted










        For a standard "box around a message", use boxes:



        echo 'This is a test' | boxes


        boxes will look like this (First one. Second one is a custom like cowsay):



        Screenshot of an asterix box and an ASCII-art dog holding a sign of text




        If you mean an alert box, use notify-send:



        notify-send 'title' 'message'


        notify-send looks like this:



        Pop-up message reading "Hello Ashframe..."




        You also can use zenity for a popup window:



        zenity --error --text="An error occurred!" --title="Warning!"


        Zenity is more graphical and has more options, like having the window appear as a question, using:



        zenity --question --text="Do you wish to continue/?"


        or even progress bars, using:



        find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."


        zenity looks like this:



        error, question, info, and warning dialog boxes with buttons




        Or use dialog, for a command-line only message box:



        dialog --checklist "Choose OS:" 15 40 5 
        1 Linux off
        2 Solaris on
        3 'HP UX' off
        4 AIX off


        dialog looks like this:



        dialog TUI with 4 options




        Another option is whiptail:



        whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78


        whiptail looks like this:



        whiptail pop-up box with two text buttons




        And if you are truly crazy, use toilet:



        toilet -F border -F gay "CRAZY"


        toilet looks like this:



        colorful text box reading "CRAZY"



        • Source for boxes

        • Source for dialog 1

        • Source for dialog 2

        • Source for zenity 1

        • Source for zenity 2

        • Source for whiptail 1

        • Source for whiptail 2

        • Source for toilet





        share|improve this answer


















        • 2




          Really complete answer, it's useful! Thank you!
          – JBFWP286
          Mar 21 '17 at 0:46














        up vote
        86
        down vote



        accepted










        For a standard "box around a message", use boxes:



        echo 'This is a test' | boxes


        boxes will look like this (First one. Second one is a custom like cowsay):



        Screenshot of an asterix box and an ASCII-art dog holding a sign of text




        If you mean an alert box, use notify-send:



        notify-send 'title' 'message'


        notify-send looks like this:



        Pop-up message reading "Hello Ashframe..."




        You also can use zenity for a popup window:



        zenity --error --text="An error occurred!" --title="Warning!"


        Zenity is more graphical and has more options, like having the window appear as a question, using:



        zenity --question --text="Do you wish to continue/?"


        or even progress bars, using:



        find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."


        zenity looks like this:



        error, question, info, and warning dialog boxes with buttons




        Or use dialog, for a command-line only message box:



        dialog --checklist "Choose OS:" 15 40 5 
        1 Linux off
        2 Solaris on
        3 'HP UX' off
        4 AIX off


        dialog looks like this:



        dialog TUI with 4 options




        Another option is whiptail:



        whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78


        whiptail looks like this:



        whiptail pop-up box with two text buttons




        And if you are truly crazy, use toilet:



        toilet -F border -F gay "CRAZY"


        toilet looks like this:



        colorful text box reading "CRAZY"



        • Source for boxes

        • Source for dialog 1

        • Source for dialog 2

        • Source for zenity 1

        • Source for zenity 2

        • Source for whiptail 1

        • Source for whiptail 2

        • Source for toilet





        share|improve this answer


















        • 2




          Really complete answer, it's useful! Thank you!
          – JBFWP286
          Mar 21 '17 at 0:46












        up vote
        86
        down vote



        accepted







        up vote
        86
        down vote



        accepted






        For a standard "box around a message", use boxes:



        echo 'This is a test' | boxes


        boxes will look like this (First one. Second one is a custom like cowsay):



        Screenshot of an asterix box and an ASCII-art dog holding a sign of text




        If you mean an alert box, use notify-send:



        notify-send 'title' 'message'


        notify-send looks like this:



        Pop-up message reading "Hello Ashframe..."




        You also can use zenity for a popup window:



        zenity --error --text="An error occurred!" --title="Warning!"


        Zenity is more graphical and has more options, like having the window appear as a question, using:



        zenity --question --text="Do you wish to continue/?"


        or even progress bars, using:



        find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."


        zenity looks like this:



        error, question, info, and warning dialog boxes with buttons




        Or use dialog, for a command-line only message box:



        dialog --checklist "Choose OS:" 15 40 5 
        1 Linux off
        2 Solaris on
        3 'HP UX' off
        4 AIX off


        dialog looks like this:



        dialog TUI with 4 options




        Another option is whiptail:



        whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78


        whiptail looks like this:



        whiptail pop-up box with two text buttons




        And if you are truly crazy, use toilet:



        toilet -F border -F gay "CRAZY"


        toilet looks like this:



        colorful text box reading "CRAZY"



        • Source for boxes

        • Source for dialog 1

        • Source for dialog 2

        • Source for zenity 1

        • Source for zenity 2

        • Source for whiptail 1

        • Source for whiptail 2

        • Source for toilet





        share|improve this answer














        For a standard "box around a message", use boxes:



        echo 'This is a test' | boxes


        boxes will look like this (First one. Second one is a custom like cowsay):



        Screenshot of an asterix box and an ASCII-art dog holding a sign of text




        If you mean an alert box, use notify-send:



        notify-send 'title' 'message'


        notify-send looks like this:



        Pop-up message reading "Hello Ashframe..."




        You also can use zenity for a popup window:



        zenity --error --text="An error occurred!" --title="Warning!"


        Zenity is more graphical and has more options, like having the window appear as a question, using:



        zenity --question --text="Do you wish to continue/?"


        or even progress bars, using:



        find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."


        zenity looks like this:



        error, question, info, and warning dialog boxes with buttons




        Or use dialog, for a command-line only message box:



        dialog --checklist "Choose OS:" 15 40 5 
        1 Linux off
        2 Solaris on
        3 'HP UX' off
        4 AIX off


        dialog looks like this:



        dialog TUI with 4 options




        Another option is whiptail:



        whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78


        whiptail looks like this:



        whiptail pop-up box with two text buttons




        And if you are truly crazy, use toilet:



        toilet -F border -F gay "CRAZY"


        toilet looks like this:



        colorful text box reading "CRAZY"



        • Source for boxes

        • Source for dialog 1

        • Source for dialog 2

        • Source for zenity 1

        • Source for zenity 2

        • Source for whiptail 1

        • Source for whiptail 2

        • Source for toilet






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 7 at 0:59









        Jeff Schaller

        35.9k952119




        35.9k952119










        answered Jul 16 '14 at 18:43









        polym

        6,42643156




        6,42643156







        • 2




          Really complete answer, it's useful! Thank you!
          – JBFWP286
          Mar 21 '17 at 0:46












        • 2




          Really complete answer, it's useful! Thank you!
          – JBFWP286
          Mar 21 '17 at 0:46







        2




        2




        Really complete answer, it's useful! Thank you!
        – JBFWP286
        Mar 21 '17 at 0:46




        Really complete answer, it's useful! Thank you!
        – JBFWP286
        Mar 21 '17 at 0:46












        up vote
        17
        down vote













        xmessage



        This is the granddaddy of GUI alerts:



        xmessage -center "Hello, World!"




        Pure retro goodness.



        I also bet that it should be widely available on X11 systems.



        SO thread: How to show a GUI message box from a bash script in linux? | Stack Overflow



        Tested in Ubuntu 18.04.






        share|improve this answer


























          up vote
          17
          down vote













          xmessage



          This is the granddaddy of GUI alerts:



          xmessage -center "Hello, World!"




          Pure retro goodness.



          I also bet that it should be widely available on X11 systems.



          SO thread: How to show a GUI message box from a bash script in linux? | Stack Overflow



          Tested in Ubuntu 18.04.






          share|improve this answer
























            up vote
            17
            down vote










            up vote
            17
            down vote









            xmessage



            This is the granddaddy of GUI alerts:



            xmessage -center "Hello, World!"




            Pure retro goodness.



            I also bet that it should be widely available on X11 systems.



            SO thread: How to show a GUI message box from a bash script in linux? | Stack Overflow



            Tested in Ubuntu 18.04.






            share|improve this answer














            xmessage



            This is the granddaddy of GUI alerts:



            xmessage -center "Hello, World!"




            Pure retro goodness.



            I also bet that it should be widely available on X11 systems.



            SO thread: How to show a GUI message box from a bash script in linux? | Stack Overflow



            Tested in Ubuntu 18.04.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered Aug 26 '16 at 19:53









            Ciro Santilli 新疆改造中心 六四事件 法轮功

            4,64824038




            4,64824038




















                up vote
                7
                down vote













                And then just because @polym's completely over the top answer missed the classic messaging:



                write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with echo "message" | write username



                write




                And the complement to write, wall to send a message to all users



                wall






                share|improve this answer
























                  up vote
                  7
                  down vote













                  And then just because @polym's completely over the top answer missed the classic messaging:



                  write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with echo "message" | write username



                  write




                  And the complement to write, wall to send a message to all users



                  wall






                  share|improve this answer






















                    up vote
                    7
                    down vote










                    up vote
                    7
                    down vote









                    And then just because @polym's completely over the top answer missed the classic messaging:



                    write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with echo "message" | write username



                    write




                    And the complement to write, wall to send a message to all users



                    wall






                    share|improve this answer












                    And then just because @polym's completely over the top answer missed the classic messaging:



                    write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with echo "message" | write username



                    write




                    And the complement to write, wall to send a message to all users



                    wall







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 16 '14 at 22:13









                    HBruijn

                    5,4761525




                    5,4761525




















                        up vote
                        0
                        down vote













                        If you are willing to pipe the text to a Python wrapper, you can use terminaltables:



                        pip3 install colorclass
                        pip3 install terminaltables


                        Then in the GitHub Repo, you can use one of the examples to write a python wrapper.



                        enter image description here






                        share|improve this answer
























                          up vote
                          0
                          down vote













                          If you are willing to pipe the text to a Python wrapper, you can use terminaltables:



                          pip3 install colorclass
                          pip3 install terminaltables


                          Then in the GitHub Repo, you can use one of the examples to write a python wrapper.



                          enter image description here






                          share|improve this answer






















                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            If you are willing to pipe the text to a Python wrapper, you can use terminaltables:



                            pip3 install colorclass
                            pip3 install terminaltables


                            Then in the GitHub Repo, you can use one of the examples to write a python wrapper.



                            enter image description here






                            share|improve this answer












                            If you are willing to pipe the text to a Python wrapper, you can use terminaltables:



                            pip3 install colorclass
                            pip3 install terminaltables


                            Then in the GitHub Repo, you can use one of the examples to write a python wrapper.



                            enter image description here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 10 at 12:15









                            not2qubit

                            690714




                            690714



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f144924%2fhow-to-create-a-message-box-from-the-command-line%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown






                                Popular posts from this blog

                                How to check contact read email or not when send email to Individual?

                                Displaying single band from multi-band raster using QGIS

                                How many registers does an x86_64 CPU actually have?