[openbox] Move all windows to other desktop – reopened

Mikael Magnusson mikachu at gmail.com
Mon Feb 13 14:13:36 EST 2017


On Mon, Feb 13, 2017 at 5:45 PM, Martin Jiřička <mjiricka at gmail.com> wrote:
> Hello!
>
> I would like to move all windows to another desktop in the same way as
> I can move one window with SendToDesktop. Which means this bind
>
>     <keybind key="W-C-l">
>         <action name="SendToDesktop"><to>right</to></action>
>     </keybind>
>
> allows me to select a window, press Win+Ctrl key a then press twice
> key "L" to send the window to workspace that is two columns right from
> the starting workspace.
>
> There were already a question about this and also proposed solution:
>
> http://icculus.org/pipermail/openbox/2015-September/008939.html
>
> So I tried something like this:
>
>     <keybind  key="W-C-S-l">
>         <action  name="ForEach">
>             <omnipresent>no</omnipresent>
>             <then>
>                 <action  name="If">
>                     <desktop>current</desktop>
>                     <then>
>                         <action  name="SendToDesktop">
>                             <to>right</to>
>                             <follow>no</follow>
>                         </action>
>                     </then>
>                 </action>
>             </then>
>         </action>
>     </keybind>
>
> Problem is that it cannot be used the same way as SendToDesktop,
> because it must be used "in two steps" (send all windows to right,
> switch to right desktop, send all windows to right), which "picks up"
> also all windows that are between source and destination workspace.
>
> I remember Mate or Xfce (or both, I am not sure) used to have
> MoveDesktop action that worked as I want, i.e. as SendToDesktop with a
> single window.
>
> Is there any other way how to achieve desired functionality?

The closest you can probably reasonably get is to first go to the
target desktop for 1 second, then go to the source desktop and use
sendtodesktop to=last

For comparison I have this menu item that swaps the current desktop
with the last desktop:
<item label="Swap windows with previous 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>

I'm not 100% sure that the latest release lets you use "last" for the
desktop condition but you don't need that for your usecase.

-- 
Mikael Magnusson


More information about the openbox mailing list