How to create a menu item in KDE that executes a terminal command?












1















I have been trying to accomplish this task for years and every time I try it, I fail miserably and simply give up completely after Googling it and trying for hours. This time though, I decided to seek help from you!



Logically speaking, It should be a very straightforward simple task as follows:



Step 1: Right-click on the menu button, then go to "Edit Applications".



enter image description here



Step 2: Click on "Add new item", assign a menu entry name then create your launcher or command.



No matter how many variations of commands I try, it is never working out. I tried to launch the Konsole terminal then execute the command, but the Konsole is not holding still and closing automatically even after issuing the right flag to keep it running.



konsole -e anaconda-navigator --noclose


enter image description here



Specifying the command directly also does not work out and simply renders nothing on the screen.



anaconda-navigator


enter image description here



I wonder why it has to be very hard like that. Your help will be greatly appreciated!



My System Information - For Reference:



enter image description here










share|improve this question



























    1















    I have been trying to accomplish this task for years and every time I try it, I fail miserably and simply give up completely after Googling it and trying for hours. This time though, I decided to seek help from you!



    Logically speaking, It should be a very straightforward simple task as follows:



    Step 1: Right-click on the menu button, then go to "Edit Applications".



    enter image description here



    Step 2: Click on "Add new item", assign a menu entry name then create your launcher or command.



    No matter how many variations of commands I try, it is never working out. I tried to launch the Konsole terminal then execute the command, but the Konsole is not holding still and closing automatically even after issuing the right flag to keep it running.



    konsole -e anaconda-navigator --noclose


    enter image description here



    Specifying the command directly also does not work out and simply renders nothing on the screen.



    anaconda-navigator


    enter image description here



    I wonder why it has to be very hard like that. Your help will be greatly appreciated!



    My System Information - For Reference:



    enter image description here










    share|improve this question

























      1












      1








      1


      1






      I have been trying to accomplish this task for years and every time I try it, I fail miserably and simply give up completely after Googling it and trying for hours. This time though, I decided to seek help from you!



      Logically speaking, It should be a very straightforward simple task as follows:



      Step 1: Right-click on the menu button, then go to "Edit Applications".



      enter image description here



      Step 2: Click on "Add new item", assign a menu entry name then create your launcher or command.



      No matter how many variations of commands I try, it is never working out. I tried to launch the Konsole terminal then execute the command, but the Konsole is not holding still and closing automatically even after issuing the right flag to keep it running.



      konsole -e anaconda-navigator --noclose


      enter image description here



      Specifying the command directly also does not work out and simply renders nothing on the screen.



      anaconda-navigator


      enter image description here



      I wonder why it has to be very hard like that. Your help will be greatly appreciated!



      My System Information - For Reference:



      enter image description here










      share|improve this question














      I have been trying to accomplish this task for years and every time I try it, I fail miserably and simply give up completely after Googling it and trying for hours. This time though, I decided to seek help from you!



      Logically speaking, It should be a very straightforward simple task as follows:



      Step 1: Right-click on the menu button, then go to "Edit Applications".



      enter image description here



      Step 2: Click on "Add new item", assign a menu entry name then create your launcher or command.



      No matter how many variations of commands I try, it is never working out. I tried to launch the Konsole terminal then execute the command, but the Konsole is not holding still and closing automatically even after issuing the right flag to keep it running.



      konsole -e anaconda-navigator --noclose


      enter image description here



      Specifying the command directly also does not work out and simply renders nothing on the screen.



      anaconda-navigator


      enter image description here



      I wonder why it has to be very hard like that. Your help will be greatly appreciated!



      My System Information - For Reference:



      enter image description here







      command-line kubuntu 17.10 kde anaconda






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 14 '18 at 3:58









      KenKen

      6761823




      6761823






















          3 Answers
          3






          active

          oldest

          votes


















          1














          According to the --help option the -e should be the last part of the line:



          -e <cmd>                  Command to execute. This option will catch all following arguments, so use it as the last option.


          So, to run the command to keep it open, it would then be:



          konsole --noclose -e anaconda-navigator


          Hope this helps!






          share|improve this answer
























          • Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

            – Ken
            Apr 14 '18 at 5:31











          • @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

            – Terrance
            Apr 14 '18 at 5:35











          • All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

            – Ken
            Apr 14 '18 at 5:44











          • @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

            – sudodus
            Apr 14 '18 at 6:51



















          1














          Here is how I was able to do it, using the example of command



          fortune | cowsay




          1. Open a text editor and type



            #!/bin/bash
            fortune | cowsay


          2. Save file as cow.sh ( or any name you wish and note location path)



          3. Open KDE Menu Editor ( note to use proper path to your cow.sh )



            Command:



            konsole --noclose -e /home/username/Documents/cow.sh


          4. click save and test it!







          share|improve this answer










          New contributor




          velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




























            0














            anaconda-navigator should run without any additional parameters.



            Ensure the path to anaconda is in ~/.bachrc
            i.e.



            export PATH="/home/<user>/path/to/anaconda3/bin:$PATH"


            Ensure conda is updated: (this next command will fail, but it will give you the correct command for updating your system.)



            conda update


            Otherwise, a plasma config file might require deletion/recreation. Try renaming one or both of the following files (Warning: Desktop settings will be set back to default!):




            • ~/.config/plasmashellrc

            • ~/.config/plasma-org.kde.plasma.desktop-appletsrc


            Then restart plasma:



            killall plasmashell && plasmashell &





            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              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%2faskubuntu.com%2fquestions%2f1024849%2fhow-to-create-a-menu-item-in-kde-that-executes-a-terminal-command%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              According to the --help option the -e should be the last part of the line:



              -e <cmd>                  Command to execute. This option will catch all following arguments, so use it as the last option.


              So, to run the command to keep it open, it would then be:



              konsole --noclose -e anaconda-navigator


              Hope this helps!






              share|improve this answer
























              • Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

                – Ken
                Apr 14 '18 at 5:31











              • @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

                – Terrance
                Apr 14 '18 at 5:35











              • All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

                – Ken
                Apr 14 '18 at 5:44











              • @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

                – sudodus
                Apr 14 '18 at 6:51
















              1














              According to the --help option the -e should be the last part of the line:



              -e <cmd>                  Command to execute. This option will catch all following arguments, so use it as the last option.


              So, to run the command to keep it open, it would then be:



              konsole --noclose -e anaconda-navigator


              Hope this helps!






              share|improve this answer
























              • Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

                – Ken
                Apr 14 '18 at 5:31











              • @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

                – Terrance
                Apr 14 '18 at 5:35











              • All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

                – Ken
                Apr 14 '18 at 5:44











              • @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

                – sudodus
                Apr 14 '18 at 6:51














              1












              1








              1







              According to the --help option the -e should be the last part of the line:



              -e <cmd>                  Command to execute. This option will catch all following arguments, so use it as the last option.


              So, to run the command to keep it open, it would then be:



              konsole --noclose -e anaconda-navigator


              Hope this helps!






              share|improve this answer













              According to the --help option the -e should be the last part of the line:



              -e <cmd>                  Command to execute. This option will catch all following arguments, so use it as the last option.


              So, to run the command to keep it open, it would then be:



              konsole --noclose -e anaconda-navigator


              Hope this helps!







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 14 '18 at 4:58









              TerranceTerrance

              20k34898




              20k34898













              • Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

                – Ken
                Apr 14 '18 at 5:31











              • @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

                – Terrance
                Apr 14 '18 at 5:35











              • All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

                – Ken
                Apr 14 '18 at 5:44











              • @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

                – sudodus
                Apr 14 '18 at 6:51



















              • Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

                – Ken
                Apr 14 '18 at 5:31











              • @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

                – Terrance
                Apr 14 '18 at 5:35











              • All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

                – Ken
                Apr 14 '18 at 5:44











              • @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

                – sudodus
                Apr 14 '18 at 6:51

















              Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

              – Ken
              Apr 14 '18 at 5:31





              Thank you for your reply. The terminal window is opening but it is closing instantly after a second. It is still not working out for me even if the -e flag is at the end.

              – Ken
              Apr 14 '18 at 5:31













              @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

              – Terrance
              Apr 14 '18 at 5:35





              @Ken Can you try it with another command possibly? All the tests I have ran at it seem to keep the terminal open even if it is a command that doesn't exist. konsole --noclose -e ls returns a listing of my folder but keeps the window open.

              – Terrance
              Apr 14 '18 at 5:35













              All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

              – Ken
              Apr 14 '18 at 5:44





              All types of commands are not working out for me. The commands are just working if I am plugging them manually into the terminal.

              – Ken
              Apr 14 '18 at 5:44













              @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

              – sudodus
              Apr 14 '18 at 6:51





              @Ken, please show us a command line with konsole --noclose -e some-command, that does not work for you, and we can debug it in our systems. - An alternative might be to [install if necessary and] use old xterm like so, xterm -fa default -fs 12 -hold -e lsb_release -a &

              – sudodus
              Apr 14 '18 at 6:51













              1














              Here is how I was able to do it, using the example of command



              fortune | cowsay




              1. Open a text editor and type



                #!/bin/bash
                fortune | cowsay


              2. Save file as cow.sh ( or any name you wish and note location path)



              3. Open KDE Menu Editor ( note to use proper path to your cow.sh )



                Command:



                konsole --noclose -e /home/username/Documents/cow.sh


              4. click save and test it!







              share|improve this answer










              New contributor




              velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                1














                Here is how I was able to do it, using the example of command



                fortune | cowsay




                1. Open a text editor and type



                  #!/bin/bash
                  fortune | cowsay


                2. Save file as cow.sh ( or any name you wish and note location path)



                3. Open KDE Menu Editor ( note to use proper path to your cow.sh )



                  Command:



                  konsole --noclose -e /home/username/Documents/cow.sh


                4. click save and test it!







                share|improve this answer










                New contributor




                velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  1












                  1








                  1







                  Here is how I was able to do it, using the example of command



                  fortune | cowsay




                  1. Open a text editor and type



                    #!/bin/bash
                    fortune | cowsay


                  2. Save file as cow.sh ( or any name you wish and note location path)



                  3. Open KDE Menu Editor ( note to use proper path to your cow.sh )



                    Command:



                    konsole --noclose -e /home/username/Documents/cow.sh


                  4. click save and test it!







                  share|improve this answer










                  New contributor




                  velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  Here is how I was able to do it, using the example of command



                  fortune | cowsay




                  1. Open a text editor and type



                    #!/bin/bash
                    fortune | cowsay


                  2. Save file as cow.sh ( or any name you wish and note location path)



                  3. Open KDE Menu Editor ( note to use proper path to your cow.sh )



                    Command:



                    konsole --noclose -e /home/username/Documents/cow.sh


                  4. click save and test it!








                  share|improve this answer










                  New contributor




                  velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer








                  edited 3 hours ago









                  zx485

                  1,47131115




                  1,47131115






                  New contributor




                  velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 4 hours ago









                  velidvelid

                  111




                  111




                  New contributor




                  velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  velid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.























                      0














                      anaconda-navigator should run without any additional parameters.



                      Ensure the path to anaconda is in ~/.bachrc
                      i.e.



                      export PATH="/home/<user>/path/to/anaconda3/bin:$PATH"


                      Ensure conda is updated: (this next command will fail, but it will give you the correct command for updating your system.)



                      conda update


                      Otherwise, a plasma config file might require deletion/recreation. Try renaming one or both of the following files (Warning: Desktop settings will be set back to default!):




                      • ~/.config/plasmashellrc

                      • ~/.config/plasma-org.kde.plasma.desktop-appletsrc


                      Then restart plasma:



                      killall plasmashell && plasmashell &





                      share|improve this answer




























                        0














                        anaconda-navigator should run without any additional parameters.



                        Ensure the path to anaconda is in ~/.bachrc
                        i.e.



                        export PATH="/home/<user>/path/to/anaconda3/bin:$PATH"


                        Ensure conda is updated: (this next command will fail, but it will give you the correct command for updating your system.)



                        conda update


                        Otherwise, a plasma config file might require deletion/recreation. Try renaming one or both of the following files (Warning: Desktop settings will be set back to default!):




                        • ~/.config/plasmashellrc

                        • ~/.config/plasma-org.kde.plasma.desktop-appletsrc


                        Then restart plasma:



                        killall plasmashell && plasmashell &





                        share|improve this answer


























                          0












                          0








                          0







                          anaconda-navigator should run without any additional parameters.



                          Ensure the path to anaconda is in ~/.bachrc
                          i.e.



                          export PATH="/home/<user>/path/to/anaconda3/bin:$PATH"


                          Ensure conda is updated: (this next command will fail, but it will give you the correct command for updating your system.)



                          conda update


                          Otherwise, a plasma config file might require deletion/recreation. Try renaming one or both of the following files (Warning: Desktop settings will be set back to default!):




                          • ~/.config/plasmashellrc

                          • ~/.config/plasma-org.kde.plasma.desktop-appletsrc


                          Then restart plasma:



                          killall plasmashell && plasmashell &





                          share|improve this answer













                          anaconda-navigator should run without any additional parameters.



                          Ensure the path to anaconda is in ~/.bachrc
                          i.e.



                          export PATH="/home/<user>/path/to/anaconda3/bin:$PATH"


                          Ensure conda is updated: (this next command will fail, but it will give you the correct command for updating your system.)



                          conda update


                          Otherwise, a plasma config file might require deletion/recreation. Try renaming one or both of the following files (Warning: Desktop settings will be set back to default!):




                          • ~/.config/plasmashellrc

                          • ~/.config/plasma-org.kde.plasma.desktop-appletsrc


                          Then restart plasma:



                          killall plasmashell && plasmashell &






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 14 '18 at 5:47









                          TheCummuterTheCummuter

                          362




                          362






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1024849%2fhow-to-create-a-menu-item-in-kde-that-executes-a-terminal-command%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

                              GameSpot

                              connect to host localhost port 22: Connection refused

                              Getting a Wifi WPA2 wifi connection