Resizing windows in i3 using keyboard only











up vote
17
down vote

favorite
2












I am trying to set up my computer (running Crunchbang Linux Waldorf and i3) so that it is always, by default, configured so that pressing Ctrl + Shift and arrow keys resizes the window according to the direction of the arrows.



The i3 user guide provides this example which I think is very close to what I want:



mode "resize" {
# These bindings trigger as soon as you enter the resize mode

# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt

# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt

# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}

# Enter resize mode
bindsym $mod+r mode "resize"


But I want to build it in natively, without having to enter and exit resize modes. I just want to use arrow keys, not j,k,l and semicolon keys.



Any thoughts on how I would do that?










share|improve this question




























    up vote
    17
    down vote

    favorite
    2












    I am trying to set up my computer (running Crunchbang Linux Waldorf and i3) so that it is always, by default, configured so that pressing Ctrl + Shift and arrow keys resizes the window according to the direction of the arrows.



    The i3 user guide provides this example which I think is very close to what I want:



    mode "resize" {
    # These bindings trigger as soon as you enter the resize mode

    # Pressing left will shrink the window’s width.
    # Pressing right will grow the window’s width.
    # Pressing up will shrink the window’s height.
    # Pressing down will grow the window’s height.
    bindsym j resize shrink width 10 px or 10 ppt
    bindsym k resize grow height 10 px or 10 ppt
    bindsym l resize shrink height 10 px or 10 ppt
    bindsym semicolon resize grow width 10 px or 10 ppt

    # same bindings, but for the arrow keys
    bindsym Left resize shrink width 10 px or 10 ppt
    bindsym Down resize grow height 10 px or 10 ppt
    bindsym Up resize shrink height 10 px or 10 ppt
    bindsym Right resize grow width 10 px or 10 ppt

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
    }

    # Enter resize mode
    bindsym $mod+r mode "resize"


    But I want to build it in natively, without having to enter and exit resize modes. I just want to use arrow keys, not j,k,l and semicolon keys.



    Any thoughts on how I would do that?










    share|improve this question


























      up vote
      17
      down vote

      favorite
      2









      up vote
      17
      down vote

      favorite
      2






      2





      I am trying to set up my computer (running Crunchbang Linux Waldorf and i3) so that it is always, by default, configured so that pressing Ctrl + Shift and arrow keys resizes the window according to the direction of the arrows.



      The i3 user guide provides this example which I think is very close to what I want:



      mode "resize" {
      # These bindings trigger as soon as you enter the resize mode

      # Pressing left will shrink the window’s width.
      # Pressing right will grow the window’s width.
      # Pressing up will shrink the window’s height.
      # Pressing down will grow the window’s height.
      bindsym j resize shrink width 10 px or 10 ppt
      bindsym k resize grow height 10 px or 10 ppt
      bindsym l resize shrink height 10 px or 10 ppt
      bindsym semicolon resize grow width 10 px or 10 ppt

      # same bindings, but for the arrow keys
      bindsym Left resize shrink width 10 px or 10 ppt
      bindsym Down resize grow height 10 px or 10 ppt
      bindsym Up resize shrink height 10 px or 10 ppt
      bindsym Right resize grow width 10 px or 10 ppt

      # back to normal: Enter or Escape
      bindsym Return mode "default"
      bindsym Escape mode "default"
      }

      # Enter resize mode
      bindsym $mod+r mode "resize"


      But I want to build it in natively, without having to enter and exit resize modes. I just want to use arrow keys, not j,k,l and semicolon keys.



      Any thoughts on how I would do that?










      share|improve this question















      I am trying to set up my computer (running Crunchbang Linux Waldorf and i3) so that it is always, by default, configured so that pressing Ctrl + Shift and arrow keys resizes the window according to the direction of the arrows.



      The i3 user guide provides this example which I think is very close to what I want:



      mode "resize" {
      # These bindings trigger as soon as you enter the resize mode

      # Pressing left will shrink the window’s width.
      # Pressing right will grow the window’s width.
      # Pressing up will shrink the window’s height.
      # Pressing down will grow the window’s height.
      bindsym j resize shrink width 10 px or 10 ppt
      bindsym k resize grow height 10 px or 10 ppt
      bindsym l resize shrink height 10 px or 10 ppt
      bindsym semicolon resize grow width 10 px or 10 ppt

      # same bindings, but for the arrow keys
      bindsym Left resize shrink width 10 px or 10 ppt
      bindsym Down resize grow height 10 px or 10 ppt
      bindsym Up resize shrink height 10 px or 10 ppt
      bindsym Right resize grow width 10 px or 10 ppt

      # back to normal: Enter or Escape
      bindsym Return mode "default"
      bindsym Escape mode "default"
      }

      # Enter resize mode
      bindsym $mod+r mode "resize"


      But I want to build it in natively, without having to enter and exit resize modes. I just want to use arrow keys, not j,k,l and semicolon keys.



      Any thoughts on how I would do that?







      keyboard-shortcuts i3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday









      Matthias Braun

      1,84421321




      1,84421321










      asked Jan 14 '16 at 16:58









      Oposum

      2151417




      2151417






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          12
          down vote













          Best solution that I have figured out myself:



          Go to ~/.i3/config and open the file.



          Paste following code at the end:



          bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
          bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
          bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
          bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt


          Save it and restart i3.






          share|improve this answer




























            up vote
            3
            down vote













            Base on the @Oposum's solution, I added a "fast resize" :



            # Resizing windows by 10 in i3 using keyboard only
            bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
            bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
            bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
            bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


            So in my ~/.i3/config I have:



            # Resizing windows in i3 using keyboard only
            # https://unix.stackexchange.com/q/255344/150597

            # Resizing by 1
            bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
            bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
            bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
            bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

            # Resizing by 10
            bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
            bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
            bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
            bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


            As @Oposum said : Save it and restart i3 ($mod+Shift+R).



            Hope this small addition could help too.






            share|improve this answer



















            • 1




              You have same bindings there.
              – cprn
              Feb 2 '17 at 22:52






            • 1




              @cprn Right! Fixed
              – aloisdg
              Feb 7 '17 at 13:14











            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%2f255344%2fresizing-windows-in-i3-using-keyboard-only%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








            up vote
            12
            down vote













            Best solution that I have figured out myself:



            Go to ~/.i3/config and open the file.



            Paste following code at the end:



            bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
            bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
            bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
            bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt


            Save it and restart i3.






            share|improve this answer

























              up vote
              12
              down vote













              Best solution that I have figured out myself:



              Go to ~/.i3/config and open the file.



              Paste following code at the end:



              bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
              bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
              bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
              bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt


              Save it and restart i3.






              share|improve this answer























                up vote
                12
                down vote










                up vote
                12
                down vote









                Best solution that I have figured out myself:



                Go to ~/.i3/config and open the file.



                Paste following code at the end:



                bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
                bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
                bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
                bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt


                Save it and restart i3.






                share|improve this answer












                Best solution that I have figured out myself:



                Go to ~/.i3/config and open the file.



                Paste following code at the end:



                bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
                bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
                bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
                bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt


                Save it and restart i3.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 15 '16 at 0:06









                Oposum

                2151417




                2151417
























                    up vote
                    3
                    down vote













                    Base on the @Oposum's solution, I added a "fast resize" :



                    # Resizing windows by 10 in i3 using keyboard only
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    So in my ~/.i3/config I have:



                    # Resizing windows in i3 using keyboard only
                    # https://unix.stackexchange.com/q/255344/150597

                    # Resizing by 1
                    bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
                    bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

                    # Resizing by 10
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    As @Oposum said : Save it and restart i3 ($mod+Shift+R).



                    Hope this small addition could help too.






                    share|improve this answer



















                    • 1




                      You have same bindings there.
                      – cprn
                      Feb 2 '17 at 22:52






                    • 1




                      @cprn Right! Fixed
                      – aloisdg
                      Feb 7 '17 at 13:14















                    up vote
                    3
                    down vote













                    Base on the @Oposum's solution, I added a "fast resize" :



                    # Resizing windows by 10 in i3 using keyboard only
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    So in my ~/.i3/config I have:



                    # Resizing windows in i3 using keyboard only
                    # https://unix.stackexchange.com/q/255344/150597

                    # Resizing by 1
                    bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
                    bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

                    # Resizing by 10
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    As @Oposum said : Save it and restart i3 ($mod+Shift+R).



                    Hope this small addition could help too.






                    share|improve this answer



















                    • 1




                      You have same bindings there.
                      – cprn
                      Feb 2 '17 at 22:52






                    • 1




                      @cprn Right! Fixed
                      – aloisdg
                      Feb 7 '17 at 13:14













                    up vote
                    3
                    down vote










                    up vote
                    3
                    down vote









                    Base on the @Oposum's solution, I added a "fast resize" :



                    # Resizing windows by 10 in i3 using keyboard only
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    So in my ~/.i3/config I have:



                    # Resizing windows in i3 using keyboard only
                    # https://unix.stackexchange.com/q/255344/150597

                    # Resizing by 1
                    bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
                    bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

                    # Resizing by 10
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    As @Oposum said : Save it and restart i3 ($mod+Shift+R).



                    Hope this small addition could help too.






                    share|improve this answer














                    Base on the @Oposum's solution, I added a "fast resize" :



                    # Resizing windows by 10 in i3 using keyboard only
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    So in my ~/.i3/config I have:



                    # Resizing windows in i3 using keyboard only
                    # https://unix.stackexchange.com/q/255344/150597

                    # Resizing by 1
                    bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
                    bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
                    bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

                    # Resizing by 10
                    bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
                    bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt


                    As @Oposum said : Save it and restart i3 ($mod+Shift+R).



                    Hope this small addition could help too.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Apr 13 '17 at 12:36









                    Community

                    1




                    1










                    answered Jan 21 '16 at 20:03









                    aloisdg

                    1336




                    1336








                    • 1




                      You have same bindings there.
                      – cprn
                      Feb 2 '17 at 22:52






                    • 1




                      @cprn Right! Fixed
                      – aloisdg
                      Feb 7 '17 at 13:14














                    • 1




                      You have same bindings there.
                      – cprn
                      Feb 2 '17 at 22:52






                    • 1




                      @cprn Right! Fixed
                      – aloisdg
                      Feb 7 '17 at 13:14








                    1




                    1




                    You have same bindings there.
                    – cprn
                    Feb 2 '17 at 22:52




                    You have same bindings there.
                    – cprn
                    Feb 2 '17 at 22:52




                    1




                    1




                    @cprn Right! Fixed
                    – aloisdg
                    Feb 7 '17 at 13:14




                    @cprn Right! Fixed
                    – aloisdg
                    Feb 7 '17 at 13:14


















                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f255344%2fresizing-windows-in-i3-using-keyboard-only%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