i3-msg doesn't move workspaces between multiple monitors consistently











up vote
1
down vote

favorite












I have two monitors; eDP1: primary (laptop's screen) and HDMI2, the external monitor. What I want to do is to use i3wm such that when I run a script (below), it put some workspaces on eDP1 and some on HDMI2. Using xrandr my HDMI2 is on the right side of eDP1:



xrandr --output HDMI2 --auto --right-of eDP1


Here is my script to achieve that:



#!/bin/sh

Out=HDMI2

i3-msg "$workspace1"
i3-msg "move $workspace1 to output eDP1"
i3-msg "move $workspace2 to output eDP1"
i3-msg "move $workspace3 to output eDP1"
i3-msg "move $workspace4 to output eDP1"
i3-msg "move $workspace5 to output eDP1"
i3-msg "move $workspace6 to output eDP1"
i3-msg "move $workspace7 to output eDP1"
i3-msg "move $workspace8 to output eDP1"
i3-msg "move $workspace9 to output eDP1"
i3-msg "move $workspace10 to output $Out"
i3-msg "$workspace1"
# come back to workspace 1


But this doesn't work as expected. While I intend a fixed behavior, it put the screen randomly different by each run. At the moment these two commands works pretty fine in my config file and I easily move windows between monitors:



bindsym $mod+Ctrl+greater move workspace to output right
bindsym $mod+Ctrl+less move workspace to output left




p.s. I'm on Archlinux and i3 is 4.16.1










share|improve this question




























    up vote
    1
    down vote

    favorite












    I have two monitors; eDP1: primary (laptop's screen) and HDMI2, the external monitor. What I want to do is to use i3wm such that when I run a script (below), it put some workspaces on eDP1 and some on HDMI2. Using xrandr my HDMI2 is on the right side of eDP1:



    xrandr --output HDMI2 --auto --right-of eDP1


    Here is my script to achieve that:



    #!/bin/sh

    Out=HDMI2

    i3-msg "$workspace1"
    i3-msg "move $workspace1 to output eDP1"
    i3-msg "move $workspace2 to output eDP1"
    i3-msg "move $workspace3 to output eDP1"
    i3-msg "move $workspace4 to output eDP1"
    i3-msg "move $workspace5 to output eDP1"
    i3-msg "move $workspace6 to output eDP1"
    i3-msg "move $workspace7 to output eDP1"
    i3-msg "move $workspace8 to output eDP1"
    i3-msg "move $workspace9 to output eDP1"
    i3-msg "move $workspace10 to output $Out"
    i3-msg "$workspace1"
    # come back to workspace 1


    But this doesn't work as expected. While I intend a fixed behavior, it put the screen randomly different by each run. At the moment these two commands works pretty fine in my config file and I easily move windows between monitors:



    bindsym $mod+Ctrl+greater move workspace to output right
    bindsym $mod+Ctrl+less move workspace to output left




    p.s. I'm on Archlinux and i3 is 4.16.1










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have two monitors; eDP1: primary (laptop's screen) and HDMI2, the external monitor. What I want to do is to use i3wm such that when I run a script (below), it put some workspaces on eDP1 and some on HDMI2. Using xrandr my HDMI2 is on the right side of eDP1:



      xrandr --output HDMI2 --auto --right-of eDP1


      Here is my script to achieve that:



      #!/bin/sh

      Out=HDMI2

      i3-msg "$workspace1"
      i3-msg "move $workspace1 to output eDP1"
      i3-msg "move $workspace2 to output eDP1"
      i3-msg "move $workspace3 to output eDP1"
      i3-msg "move $workspace4 to output eDP1"
      i3-msg "move $workspace5 to output eDP1"
      i3-msg "move $workspace6 to output eDP1"
      i3-msg "move $workspace7 to output eDP1"
      i3-msg "move $workspace8 to output eDP1"
      i3-msg "move $workspace9 to output eDP1"
      i3-msg "move $workspace10 to output $Out"
      i3-msg "$workspace1"
      # come back to workspace 1


      But this doesn't work as expected. While I intend a fixed behavior, it put the screen randomly different by each run. At the moment these two commands works pretty fine in my config file and I easily move windows between monitors:



      bindsym $mod+Ctrl+greater move workspace to output right
      bindsym $mod+Ctrl+less move workspace to output left




      p.s. I'm on Archlinux and i3 is 4.16.1










      share|improve this question















      I have two monitors; eDP1: primary (laptop's screen) and HDMI2, the external monitor. What I want to do is to use i3wm such that when I run a script (below), it put some workspaces on eDP1 and some on HDMI2. Using xrandr my HDMI2 is on the right side of eDP1:



      xrandr --output HDMI2 --auto --right-of eDP1


      Here is my script to achieve that:



      #!/bin/sh

      Out=HDMI2

      i3-msg "$workspace1"
      i3-msg "move $workspace1 to output eDP1"
      i3-msg "move $workspace2 to output eDP1"
      i3-msg "move $workspace3 to output eDP1"
      i3-msg "move $workspace4 to output eDP1"
      i3-msg "move $workspace5 to output eDP1"
      i3-msg "move $workspace6 to output eDP1"
      i3-msg "move $workspace7 to output eDP1"
      i3-msg "move $workspace8 to output eDP1"
      i3-msg "move $workspace9 to output eDP1"
      i3-msg "move $workspace10 to output $Out"
      i3-msg "$workspace1"
      # come back to workspace 1


      But this doesn't work as expected. While I intend a fixed behavior, it put the screen randomly different by each run. At the moment these two commands works pretty fine in my config file and I easily move windows between monitors:



      bindsym $mod+Ctrl+greater move workspace to output right
      bindsym $mod+Ctrl+less move workspace to output left




      p.s. I'm on Archlinux and i3 is 4.16.1







      multi-monitor desktop-environment i3 workspaces






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago

























      asked Nov 19 at 7:04









      SdidS

      1609




      1609



























          active

          oldest

          votes











          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%2f482688%2fi3-msg-doesnt-move-workspaces-between-multiple-monitors-consistently%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482688%2fi3-msg-doesnt-move-workspaces-between-multiple-monitors-consistently%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

          Morgemoulin

          Scott Moir

          Souastre