Maximize Window without Window Manager?












2















If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?










share|improve this question



























    2















    If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?










    share|improve this question

























      2












      2








      2


      1






      If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?










      share|improve this question














      If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?







      window-manager x-server window






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 21 '16 at 3:47









      motokumotoku

      1639




      1639






















          2 Answers
          2






          active

          oldest

          votes


















          2














          X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.



          dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
          windowid=…
          xdotool windowmove "$windowid" 0 0 windowsize "${dimensions%x*}" "${dimensions#*x}"





          share|improve this answer































            0














            I would like to open all my text files with Sublime Text, but it does not support a --maximize command line argument, and it either does not remember it window state on Linux and always open unmaximized.



            Then, after researching I built this script:



            #!/usr/bin/env bash
            # run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
            eval "${@:2}"

            while [ true ]
            do
            FocusApp=`xdotool getwindowfocus getwindowname`

            if [[ "$FocusApp" == *"$1"* ]];
            then
            # xdotool key super+Up
            wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
            break
            fi
            done


            You need to install these two things:



            sudo apt-get install wmctrl xdotool 


            I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.



            References:




            1. How to execute a command on window focus/unfocus?

            2. https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class

            3. https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal






            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%2f264684%2fmaximize-window-without-window-manager%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









              2














              X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.



              dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
              windowid=…
              xdotool windowmove "$windowid" 0 0 windowsize "${dimensions%x*}" "${dimensions#*x}"





              share|improve this answer




























                2














                X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.



                dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
                windowid=…
                xdotool windowmove "$windowid" 0 0 windowsize "${dimensions%x*}" "${dimensions#*x}"





                share|improve this answer


























                  2












                  2








                  2







                  X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.



                  dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
                  windowid=…
                  xdotool windowmove "$windowid" 0 0 windowsize "${dimensions%x*}" "${dimensions#*x}"





                  share|improve this answer













                  X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.



                  dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
                  windowid=…
                  xdotool windowmove "$windowid" 0 0 windowsize "${dimensions%x*}" "${dimensions#*x}"






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 22 '16 at 0:08









                  GillesGilles

                  539k12810911606




                  539k12810911606

























                      0














                      I would like to open all my text files with Sublime Text, but it does not support a --maximize command line argument, and it either does not remember it window state on Linux and always open unmaximized.



                      Then, after researching I built this script:



                      #!/usr/bin/env bash
                      # run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
                      eval "${@:2}"

                      while [ true ]
                      do
                      FocusApp=`xdotool getwindowfocus getwindowname`

                      if [[ "$FocusApp" == *"$1"* ]];
                      then
                      # xdotool key super+Up
                      wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
                      break
                      fi
                      done


                      You need to install these two things:



                      sudo apt-get install wmctrl xdotool 


                      I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.



                      References:




                      1. How to execute a command on window focus/unfocus?

                      2. https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class

                      3. https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal






                      share|improve this answer




























                        0














                        I would like to open all my text files with Sublime Text, but it does not support a --maximize command line argument, and it either does not remember it window state on Linux and always open unmaximized.



                        Then, after researching I built this script:



                        #!/usr/bin/env bash
                        # run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
                        eval "${@:2}"

                        while [ true ]
                        do
                        FocusApp=`xdotool getwindowfocus getwindowname`

                        if [[ "$FocusApp" == *"$1"* ]];
                        then
                        # xdotool key super+Up
                        wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
                        break
                        fi
                        done


                        You need to install these two things:



                        sudo apt-get install wmctrl xdotool 


                        I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.



                        References:




                        1. How to execute a command on window focus/unfocus?

                        2. https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class

                        3. https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal






                        share|improve this answer


























                          0












                          0








                          0







                          I would like to open all my text files with Sublime Text, but it does not support a --maximize command line argument, and it either does not remember it window state on Linux and always open unmaximized.



                          Then, after researching I built this script:



                          #!/usr/bin/env bash
                          # run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
                          eval "${@:2}"

                          while [ true ]
                          do
                          FocusApp=`xdotool getwindowfocus getwindowname`

                          if [[ "$FocusApp" == *"$1"* ]];
                          then
                          # xdotool key super+Up
                          wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
                          break
                          fi
                          done


                          You need to install these two things:



                          sudo apt-get install wmctrl xdotool 


                          I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.



                          References:




                          1. How to execute a command on window focus/unfocus?

                          2. https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class

                          3. https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal






                          share|improve this answer













                          I would like to open all my text files with Sublime Text, but it does not support a --maximize command line argument, and it either does not remember it window state on Linux and always open unmaximized.



                          Then, after researching I built this script:



                          #!/usr/bin/env bash
                          # run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
                          eval "${@:2}"

                          while [ true ]
                          do
                          FocusApp=`xdotool getwindowfocus getwindowname`

                          if [[ "$FocusApp" == *"$1"* ]];
                          then
                          # xdotool key super+Up
                          wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
                          break
                          fi
                          done


                          You need to install these two things:



                          sudo apt-get install wmctrl xdotool 


                          I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.



                          References:




                          1. How to execute a command on window focus/unfocus?

                          2. https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class

                          3. https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 13 mins ago









                          useruser

                          12518




                          12518






























                              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%2f264684%2fmaximize-window-without-window-manager%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

                              Accessing regular linux commands in Huawei's Dopra Linux

                              Can't connect RFCOMM socket: Host is down

                              Kernel panic - not syncing: Fatal Exception in Interrupt