[i3] i3-msg - move all/some workspaces to another output
Hi all, i am looking for a way to move all (or some) of my workspaces to another output. Something like in the following shell script would be nice: - #!/bin/sh WS=2 3 4 5 6 OUTPUT=VGA1 for W in $WS; do i3-msg move workspace $W to output $OUTPUT done - Is there an easy solution i have overseen? Regards, Fabian
Re: [i3] i3-msg - move all/some workspaces to another output
On 10/14, Fabian Raetz wrote: Hi all, i am looking for a way to move all (or some) of my workspaces to another output. Something like in the following shell script would be nice: - #!/bin/sh WS=2 3 4 5 6 OUTPUT=VGA1 for W in $WS; do i3-msg move workspace $W to output $OUTPUT done - Is there an easy solution i have overseen? Regards, Fabian An active monitor *must* have a workspace on it, and a workspace only exists after being explicitly created. So you can't move all currently existing workspaces to another monitor simultaneously. You'd need to first create a new workspace on the current monitor, then move all the previously created ones to a new monitor. What you can also do is use xrandr to deactivate the current display, which (if you only have two monitors in total) will move all worskpaces to the only active monitor. It's probably worth explaining exactly why you'd want to do this, though, since needing to move everything to another monitor all at once really sounds like a scenario that could be avoided with proper planning. -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. - Douglas Adams
Re: [i3] i3-msg - move all/some workspaces to another output
On Tue, Oct 14, 2014 at 10:55:07AM -0500, Bigby James wrote: On 10/14, Fabian Raetz wrote: Hi all, i am looking for a way to move all (or some) of my workspaces to another output. Something like in the following shell script would be nice: - #!/bin/sh WS=2 3 4 5 6 OUTPUT=VGA1 for W in $WS; do i3-msg move workspace $W to output $OUTPUT done - Is there an easy solution i have overseen? Regards, Fabian An active monitor *must* have a workspace on it, and a workspace only exists after being explicitly created. So you can't move all currently existing workspaces to another monitor simultaneously. You'd need to first create a new workspace on the current monitor, then move all the previously created ones to a new monitor. What you can also do is use xrandr to deactivate the current display, which (if you only have two monitors in total) will move all worskpaces to the only active monitor. It's probably worth explaining exactly why you'd want to do this, though, since needing to move everything to another monitor all at once really sounds like a scenario that could be avoided with proper planning. Sure. I am using i3wm on my Notebook which has a small screen resolution (1366x768). So it happens that i have most workspaces on a second output (VGA1). On the first output (LVDS1) is most of the time only workspace 1 and 10 active which shows xconsole/mutt/logs. Before i switch locations i detach the second output (VGA1) and all workspaces move to the first (LVDS1). Then i suspend. So far, so good. Now the problem i am trying to solve: When i resume and plug in a second monitor, i have to manually move all workspaces back to the second output which is a bit frustrating. This happens multiple times a day. I run a script whenever an output changes via an external tool, so i thought i could use the above snippet or something else to move all existing workspaces except 1 and 10 to the second output (VGA1). Any suggestions? Thanks for your time, Fabian -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. - Douglas Adams
Re: [i3] i3-msg - move all/some workspaces to another output
Have you tried assigning the workspaces to VGA1? See http://i3wm.org/docs/userguide.html#workspace_screen. When the output is unavailable, workspaces get moved to another output, which in your case is LVDS1. On Tue, Oct 14, 2014 at 8:34 PM, Fabian Raetz fabian.ra...@gmail.com wrote: On Tue, Oct 14, 2014 at 10:55:07AM -0500, Bigby James wrote: On 10/14, Fabian Raetz wrote: Hi all, i am looking for a way to move all (or some) of my workspaces to another output. Something like in the following shell script would be nice: - #!/bin/sh WS=2 3 4 5 6 OUTPUT=VGA1 for W in $WS; do i3-msg move workspace $W to output $OUTPUT done - Is there an easy solution i have overseen? Regards, Fabian An active monitor *must* have a workspace on it, and a workspace only exists after being explicitly created. So you can't move all currently existing workspaces to another monitor simultaneously. You'd need to first create a new workspace on the current monitor, then move all the previously created ones to a new monitor. What you can also do is use xrandr to deactivate the current display, which (if you only have two monitors in total) will move all worskpaces to the only active monitor. It's probably worth explaining exactly why you'd want to do this, though, since needing to move everything to another monitor all at once really sounds like a scenario that could be avoided with proper planning. Sure. I am using i3wm on my Notebook which has a small screen resolution (1366x768). So it happens that i have most workspaces on a second output (VGA1). On the first output (LVDS1) is most of the time only workspace 1 and 10 active which shows xconsole/mutt/logs. Before i switch locations i detach the second output (VGA1) and all workspaces move to the first (LVDS1). Then i suspend. So far, so good. Now the problem i am trying to solve: When i resume and plug in a second monitor, i have to manually move all workspaces back to the second output which is a bit frustrating. This happens multiple times a day. I run a script whenever an output changes via an external tool, so i thought i could use the above snippet or something else to move all existing workspaces except 1 and 10 to the second output (VGA1). Any suggestions? Thanks for your time, Fabian -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. - Douglas Adams -- Best regards, Michael
Re: [i3] i3-msg - move all/some workspaces to another output
No, but there’s a ticket for that: http://bugs.i3wm.org/report/ticket/555 On Tue, Oct 14, 2014 at 9:11 PM, Fabian Raetz fabian.ra...@gmail.com wrote: On Tue, Oct 14, 2014 at 08:53:17PM +0200, Michael Stapelberg wrote: Have you tried assigning the workspaces to VGA1? See http://i3wm.org/docs/userguide.html#workspace_screen. When the output is unavailable, workspaces get moved to another output, which in your case is LVDS1. No, but i am using it right now and it works pretty well. Can i assign a workspace to two outputs like below? Just in case i will use my HDMI port some day :) workspace 2 output VGA1 workspace 2 output HDMI1 Anyway this solves my direct needs. i3 rocks!! Thanks, Fabian On Tue, Oct 14, 2014 at 8:34 PM, Fabian Raetz fabian.ra...@gmail.com wrote: On Tue, Oct 14, 2014 at 10:55:07AM -0500, Bigby James wrote: On 10/14, Fabian Raetz wrote: Hi all, i am looking for a way to move all (or some) of my workspaces to another output. Something like in the following shell script would be nice: - #!/bin/sh WS=2 3 4 5 6 OUTPUT=VGA1 for W in $WS; do i3-msg move workspace $W to output $OUTPUT done - Is there an easy solution i have overseen? Regards, Fabian An active monitor *must* have a workspace on it, and a workspace only exists after being explicitly created. So you can't move all currently existing workspaces to another monitor simultaneously. You'd need to first create a new workspace on the current monitor, then move all the previously created ones to a new monitor. What you can also do is use xrandr to deactivate the current display, which (if you only have two monitors in total) will move all worskpaces to the only active monitor. It's probably worth explaining exactly why you'd want to do this, though, since needing to move everything to another monitor all at once really sounds like a scenario that could be avoided with proper planning. Sure. I am using i3wm on my Notebook which has a small screen resolution (1366x768). So it happens that i have most workspaces on a second output (VGA1). On the first output (LVDS1) is most of the time only workspace 1 and 10 active which shows xconsole/mutt/logs. Before i switch locations i detach the second output (VGA1) and all workspaces move to the first (LVDS1). Then i suspend. So far, so good. Now the problem i am trying to solve: When i resume and plug in a second monitor, i have to manually move all workspaces back to the second output which is a bit frustrating. This happens multiple times a day. I run a script whenever an output changes via an external tool, so i thought i could use the above snippet or something else to move all existing workspaces except 1 and 10 to the second output (VGA1). Any suggestions? Thanks for your time, Fabian -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. - Douglas Adams -- Best regards, Michael -- Best regards, Michael
Re: [i3] i3-msg - move all/some workspaces to another output
I actually have the *exact* same problem and assigning workspaces to VGA1 is not a real solution for me, as I regularly use the VGA port for presentations and such and then I actually *don't* want any workspaces (apart from the one running the presentation of course) on the beamer. I currently use something like this, to move all my workspaces to VGA1: #!/bin/sh for i in `seq 10` do i3 workspace $i, move workspace to output VGA1 done for i in `seq 10` do i3 workspace $i done i3 workspace 11, move workspace to output LVDS1 (I am not sure what the second loop was for… it had *some* point…), but it is pretty racey and very often a workspace ∈ {1,…,0} remains on LVDS1 (most often something in {5,…,8} or so, and always an empty one). I haven't found a solution to that yet and am not annoyed enough to invest a lot of time into it, but *if* anyone has a race-free way of doing that, I would be glad to hear it ;) I guess one way *might* be to unroll the loop and send all workspace-switcheroo in one ipc-command, I guess then i3 has no choice but do it sequentally in the right order… Best, Axel Wagner