segunda-feira, 29 de abril de 2013

Aero Snap in Openbox (with or without chroot)

There's quite some time I've been searching on how to do that and I finally found it. First, backup your $HOME/openbox/rc.xml. Then, insert these lines in your rc.xml in keyboard section, before </keyboard> , of course:

 </keybind>
    <keybind key="C-W-1">
      <action name="UnmaximizeFull"/>
      <action name="MaximizeVert"/>
      <action name="MoveResizeTo">
        <width>50%</width>
      </action>
      <action name="MoveToEdgeWest"/>
    </keybind>
    <keybind key="C-W-2">
      <action name="UnmaximizeFull"/>
      <action name="MaximizeVert"/>
      <action name="MoveResizeTo">
        <width>50%</width>
      </action>
      <action name="MoveToEdgeEast"/>
    </keybind>
    <keybind key="C-W-3">
      <action name="UnmaximizeFull"/>
      <action name="Maximize">
        <direction>horizontal</direction>
      </action>
      <action name="MoveResizeTo">
        <height>50%</height>
      </action>
      <action name="MoveToEdgeNorth"/>
    </keybind>
    <keybind key="C-W-4">
      <action name="UnmaximizeFull"/>
      <action name="Maximize">
        <direction>horizontal</direction>
      </action>
      <action name="MoveResizeTo">
        <height>50%</height>
      </action> </keybind>
        </keybind>
    <keybind key="C-W-w" chroot="true">
      <keybind key="Left">
        <action name="UnmaximizeFull"/>
        <action name="MaximizeVert"/>
        <action name="MoveResizeTo">
          <width>50%</width>
        </action>
        <action name="MoveToEdgeWest"/>
      </keybind>
      <keybind key="Right">
        <action name="UnmaximizeFull"/>
        <action name="MaximizeVert"/>
        <action name="MoveResizeTo">
          <width>50%</width>
        </action>
        <action name="MoveToEdgeEast"/>
      </keybind>
      <keybind key="Down">
        <action name="UnmaximizeFull"/>
        <action name="Maximize">
          <direction>horizontal</direction>
        </action>
        <action name="MoveResizeTo">
          <height>50%</height>
        </action>
        <action name="MoveToEdgeSouth"/>
      </keybind>
      <keybind key="Up">
        <action name="UnmaximizeFull"/>
        <action name="Maximize">
          <direction>horizontal</direction>
        </action>
        <action name="MoveResizeTo">
          <height>50%</height>
        </action>
        <action name="MoveToEdgeNorth"/>
      </keybind>
      <keybind key="Escape">
        <action name="BreakChroot"/>
      </keybind>
    </keybind>

  
An openbox --reconfigure in the terminal will make it available in your openbox, after inserting the code into rc.xml file. The code enables two methods of doing aero-snapping: The first one allows you to make aero-snapping  pressing ctrl+windows+1 to 4. The second one, pressing in the same time ctrl+windows+w you will be sent to a chroot and you can move windows with keyboard directionals (up, down, right and left), and escaping with "esc". Thanks for the idea, folks from Crunchbang forum!! I slightly change it, but it works like a charm! Hope it'll be useful for everyone! .

Nenhum comentário: