Re: Move all windows to other desktop

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.window-managers.openbox
Message-ID <CAHYJk3SR1Rty9SLm0Wn0-VKMKv439=L_JPUGQgjf2UmtFr+Tyw@mail.gmail.com>
On Thu, Sep 3, 2015 at 2:34 PM, Mathias Dufresne
<[email protected]> wrote:
> In my menu.xml I did added both your nice tricks as follow:
>
> <menu id="apps-desktop-mgmt" label="Desktop Management">
>   <item label="New Desktop before that one">
>     <action name="AddDesktop">
>       <where>current</where>
>     </action>
>   </item>
>   <separator />
>   <item label="Move all windows to previously visited desktop">
>     <action name="ForEach">
>       <desktop>current</desktop>
>       <then>
>         <action name="SendToDesktop">
>           <to>last</to>
>         </action>
>       </then>
>     </action>
>   </item>
> </menu>
>
> This works when adding a new desktop but I'm not able to move all windows at
> once.

I forgot follow is on by default for SendToDesktop, which is not so
great in the ForEach action, add <follow>no</follow> in there after
the </to> and it should work.

I was going to suggest the following too,

<item label="Swap windows with last desktop">
  <action name="ForEach">
    <omnipresent>no</omnipresent>
    <then>
      <action name="If">
        <desktop>current</desktop>
        <then>
          <action name="SendToDesktop">
            <to>last</to>
            <follow>no</follow>
          </action>
        </then>
        <else>
          <action name="If">
            <desktop>last</desktop>
            <then>
              <action name="SendToDesktop">
                <to>current</to>
                <follow>no</follow>
              </action>
            </then>
          </action>
        </else>
      </action>
    </then>
  </action>
</item>

(yay nested tags), but as it turns out, I never thought to add "last"
as a possible condition for the if/foreach desktop tag. The above
should work in the next release though :).

-- 
Mikael Magnusson
_______________________________________________
openbox mailing list
[email protected]
http://icculus.org/mailman/listinfo/openbox
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.