how to open multiple windows in a predefined arrangement with a single command












2















I want to write a single bash script/configuration/whatever to open up multiple windows with a predefined arrangement by executing a single command.



For example, when I get notified about problems with the mail server, I want to execute connect_mailserver.sh which opens up a window-container containing




  • a window showing tail -f /var/log/mail.log

  • a window showing htop

  • a browser window showing all mail-related checks in Nagios

  • a shell for doing stuff on that server

  • ...


All the windows should be started in predefined positions but I should also be able to move and resize them.



I believe there are many elegant solutions for that, maybe with screen or emacs. Maybe there is a better tool for that? Do you have a similar solution?










share|improve this question

























  • Which desktop environment are you using? (KDE, gnome, lxde, ...). A session manager can store and restore windows (with positions), but it depends on your desktop.

    – Giacomo Catenazzi
    Feb 12 '16 at 20:06











  • Oh right, forgot to mention it. I'm using Mate, so all Gnome stuff should work.

    – Ethan Leroy
    Feb 12 '16 at 20:12






  • 1





    it's been a while, but the old xterm utility used to take a -geometry parameter that let you specify a size and position

    – Jeff Schaller
    Feb 12 '16 at 20:41
















2















I want to write a single bash script/configuration/whatever to open up multiple windows with a predefined arrangement by executing a single command.



For example, when I get notified about problems with the mail server, I want to execute connect_mailserver.sh which opens up a window-container containing




  • a window showing tail -f /var/log/mail.log

  • a window showing htop

  • a browser window showing all mail-related checks in Nagios

  • a shell for doing stuff on that server

  • ...


All the windows should be started in predefined positions but I should also be able to move and resize them.



I believe there are many elegant solutions for that, maybe with screen or emacs. Maybe there is a better tool for that? Do you have a similar solution?










share|improve this question

























  • Which desktop environment are you using? (KDE, gnome, lxde, ...). A session manager can store and restore windows (with positions), but it depends on your desktop.

    – Giacomo Catenazzi
    Feb 12 '16 at 20:06











  • Oh right, forgot to mention it. I'm using Mate, so all Gnome stuff should work.

    – Ethan Leroy
    Feb 12 '16 at 20:12






  • 1





    it's been a while, but the old xterm utility used to take a -geometry parameter that let you specify a size and position

    – Jeff Schaller
    Feb 12 '16 at 20:41














2












2








2








I want to write a single bash script/configuration/whatever to open up multiple windows with a predefined arrangement by executing a single command.



For example, when I get notified about problems with the mail server, I want to execute connect_mailserver.sh which opens up a window-container containing




  • a window showing tail -f /var/log/mail.log

  • a window showing htop

  • a browser window showing all mail-related checks in Nagios

  • a shell for doing stuff on that server

  • ...


All the windows should be started in predefined positions but I should also be able to move and resize them.



I believe there are many elegant solutions for that, maybe with screen or emacs. Maybe there is a better tool for that? Do you have a similar solution?










share|improve this question
















I want to write a single bash script/configuration/whatever to open up multiple windows with a predefined arrangement by executing a single command.



For example, when I get notified about problems with the mail server, I want to execute connect_mailserver.sh which opens up a window-container containing




  • a window showing tail -f /var/log/mail.log

  • a window showing htop

  • a browser window showing all mail-related checks in Nagios

  • a shell for doing stuff on that server

  • ...


All the windows should be started in predefined positions but I should also be able to move and resize them.



I believe there are many elegant solutions for that, maybe with screen or emacs. Maybe there is a better tool for that? Do you have a similar solution?







gui toolchain






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 14 mins ago









Rui F Ribeiro

40.1k1479136




40.1k1479136










asked Feb 12 '16 at 19:25









Ethan LeroyEthan Leroy

1162




1162













  • Which desktop environment are you using? (KDE, gnome, lxde, ...). A session manager can store and restore windows (with positions), but it depends on your desktop.

    – Giacomo Catenazzi
    Feb 12 '16 at 20:06











  • Oh right, forgot to mention it. I'm using Mate, so all Gnome stuff should work.

    – Ethan Leroy
    Feb 12 '16 at 20:12






  • 1





    it's been a while, but the old xterm utility used to take a -geometry parameter that let you specify a size and position

    – Jeff Schaller
    Feb 12 '16 at 20:41



















  • Which desktop environment are you using? (KDE, gnome, lxde, ...). A session manager can store and restore windows (with positions), but it depends on your desktop.

    – Giacomo Catenazzi
    Feb 12 '16 at 20:06











  • Oh right, forgot to mention it. I'm using Mate, so all Gnome stuff should work.

    – Ethan Leroy
    Feb 12 '16 at 20:12






  • 1





    it's been a while, but the old xterm utility used to take a -geometry parameter that let you specify a size and position

    – Jeff Schaller
    Feb 12 '16 at 20:41

















Which desktop environment are you using? (KDE, gnome, lxde, ...). A session manager can store and restore windows (with positions), but it depends on your desktop.

– Giacomo Catenazzi
Feb 12 '16 at 20:06





Which desktop environment are you using? (KDE, gnome, lxde, ...). A session manager can store and restore windows (with positions), but it depends on your desktop.

– Giacomo Catenazzi
Feb 12 '16 at 20:06













Oh right, forgot to mention it. I'm using Mate, so all Gnome stuff should work.

– Ethan Leroy
Feb 12 '16 at 20:12





Oh right, forgot to mention it. I'm using Mate, so all Gnome stuff should work.

– Ethan Leroy
Feb 12 '16 at 20:12




1




1





it's been a while, but the old xterm utility used to take a -geometry parameter that let you specify a size and position

– Jeff Schaller
Feb 12 '16 at 20:41





it's been a while, but the old xterm utility used to take a -geometry parameter that let you specify a size and position

– Jeff Schaller
Feb 12 '16 at 20:41










2 Answers
2






active

oldest

votes


















1














Probably not as elegant as you may wish, but I'd use wmctrl for this.



xterm -T mail.log -e tail -f /var/log/mail.log &
until wmctrl -F -r mail.log -e0,<posx>,<posy>,<width>,<height>
do sleep .1s
done


Of course you may use other apps than xterm. wmctrl can only match window titles or window IDs. If you cannot set your window title, you'll have to find its ID by grep-ing the output of wmctrl -lp for the relevant PID.






share|improve this answer































    0














    Use



    xterm -geometry 120x50+100+100 -e 'command'


    The geometry parameter reads like this: LINESxCOLUMNS+XSTART+YSTART



    If you want to find out the geometry parameters, open up several xterms, and start "xwininfo" in another, then clicking on the window you wish to know the geometry parameter of.






    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',
      autoActivateHeartbeat: false,
      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%2f261868%2fhow-to-open-multiple-windows-in-a-predefined-arrangement-with-a-single-command%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Probably not as elegant as you may wish, but I'd use wmctrl for this.



      xterm -T mail.log -e tail -f /var/log/mail.log &
      until wmctrl -F -r mail.log -e0,<posx>,<posy>,<width>,<height>
      do sleep .1s
      done


      Of course you may use other apps than xterm. wmctrl can only match window titles or window IDs. If you cannot set your window title, you'll have to find its ID by grep-ing the output of wmctrl -lp for the relevant PID.






      share|improve this answer




























        1














        Probably not as elegant as you may wish, but I'd use wmctrl for this.



        xterm -T mail.log -e tail -f /var/log/mail.log &
        until wmctrl -F -r mail.log -e0,<posx>,<posy>,<width>,<height>
        do sleep .1s
        done


        Of course you may use other apps than xterm. wmctrl can only match window titles or window IDs. If you cannot set your window title, you'll have to find its ID by grep-ing the output of wmctrl -lp for the relevant PID.






        share|improve this answer


























          1












          1








          1







          Probably not as elegant as you may wish, but I'd use wmctrl for this.



          xterm -T mail.log -e tail -f /var/log/mail.log &
          until wmctrl -F -r mail.log -e0,<posx>,<posy>,<width>,<height>
          do sleep .1s
          done


          Of course you may use other apps than xterm. wmctrl can only match window titles or window IDs. If you cannot set your window title, you'll have to find its ID by grep-ing the output of wmctrl -lp for the relevant PID.






          share|improve this answer













          Probably not as elegant as you may wish, but I'd use wmctrl for this.



          xterm -T mail.log -e tail -f /var/log/mail.log &
          until wmctrl -F -r mail.log -e0,<posx>,<posy>,<width>,<height>
          do sleep .1s
          done


          Of course you may use other apps than xterm. wmctrl can only match window titles or window IDs. If you cannot set your window title, you'll have to find its ID by grep-ing the output of wmctrl -lp for the relevant PID.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 12 '16 at 20:34









          L. LevrelL. Levrel

          1,224415




          1,224415

























              0














              Use



              xterm -geometry 120x50+100+100 -e 'command'


              The geometry parameter reads like this: LINESxCOLUMNS+XSTART+YSTART



              If you want to find out the geometry parameters, open up several xterms, and start "xwininfo" in another, then clicking on the window you wish to know the geometry parameter of.






              share|improve this answer




























                0














                Use



                xterm -geometry 120x50+100+100 -e 'command'


                The geometry parameter reads like this: LINESxCOLUMNS+XSTART+YSTART



                If you want to find out the geometry parameters, open up several xterms, and start "xwininfo" in another, then clicking on the window you wish to know the geometry parameter of.






                share|improve this answer


























                  0












                  0








                  0







                  Use



                  xterm -geometry 120x50+100+100 -e 'command'


                  The geometry parameter reads like this: LINESxCOLUMNS+XSTART+YSTART



                  If you want to find out the geometry parameters, open up several xterms, and start "xwininfo" in another, then clicking on the window you wish to know the geometry parameter of.






                  share|improve this answer













                  Use



                  xterm -geometry 120x50+100+100 -e 'command'


                  The geometry parameter reads like this: LINESxCOLUMNS+XSTART+YSTART



                  If you want to find out the geometry parameters, open up several xterms, and start "xwininfo" in another, then clicking on the window you wish to know the geometry parameter of.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 19 '16 at 11:42









                  gerhard d.gerhard d.

                  1,136310




                  1,136310






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • 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%2funix.stackexchange.com%2fquestions%2f261868%2fhow-to-open-multiple-windows-in-a-predefined-arrangement-with-a-single-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

                      Loup dans la culture

                      How to solve the problem of ntp “Unable to contact time server” from KDE?

                      ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux