]> git.mdlowis.com Git - proto/labwc.git/commitdiff
SnapToRegion: Add documentation
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 7 Jan 2023 02:30:10 +0000 (03:30 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 11 Jan 2023 17:52:24 +0000 (18:52 +0100)
docs/labwc-actions.5.scd
docs/labwc-config.5.scd
docs/rc.xml.all

index 9cc2eceb6397f7b65b21836ddcf7ee5f3c95c5ba..10c3b542576c72dff85bd6591397ccb96eb422cc 100644 (file)
@@ -46,6 +46,10 @@ Actions are used in menus and keyboard/mouse bindings.
        Resize window to fill half the output in the given direction. Supports
        directions "left", "up", "right", "down" and "center".
 
+*<action name="SnapToRegion" region="snap-1" />*
+       Resize and move active window according to the given region.
+       See labwc-config(5) for further information on how to define regions.
+
 *<action name="NextWindow">*
        Cycle focus to next window.
 
index e00debe1a604f8391df83e3b43ce6ddc58f6cad8..070e4c042eec6250b15470b5fc47c426663ae157 100644 (file)
@@ -104,6 +104,16 @@ The rest of this man page describes configuration options.
 *<snapping><topMaximize>* [yes|no]
        Maximize window if Move operation ends on the top edge. Default is yes.
 
+## REGIONS
+
+*<regions><region name="snap-1" x="10%" y="10%" width="80%" height="80%">*
+       Define snap regions. The regions are calculated based on the usable area
+       of each output. Usable area in this context means space not exclusively
+       used by layershell clients like panels. The "%" character is required.
+       Windows can either be snapped to regions by keeping a keyboard modifier
+       pressed while moving a window (Ctrl, Alt, Shift, Logo) or by using the
+       SnapToRegion action. By default there are no regions defined.
+
 ## WORKSPACES
 
 *<desktops><names><name>*
index 52552b72a97c742cae2da1c0d70f29f382da57de..2c86fb7da7ae5c9ae8b5856d2dec5f71cd700925 100644 (file)
     </names>
   </desktops>
 
+  <!-- Percent based regions based on output usable area, % char is required -->
+  <!--
+    <regions>
+      <region name="top-left"     x="0%"  y="0%"  height="50%"  width="50%"  />
+      <region name="top"          x="0%"  y="0%"  height="50%"  width="100%" />
+      <region name="top-right"    x="50%" y="0%"  height="50%"  width="50%"  />
+      <region name="left"         x="0%"  y="0%"  height="100%" width="50%"  />
+      <region name="center"       x="10%" y="10%" height="80%"  width="80%"  />
+      <region name="right"        x="50%" y="0%"  height="100%" width="50%"  />
+      <region name="bottom-left"  x="0%"  y="50%" height="50%"  width="50%"  />
+      <region name="bottom"       x="0%"  y="50%" height="50%"  width="100%" />
+      <region name="bottom-right" x="50%" y="50%" height="50%"  width="50%"  />
+    </regions>
+  -->
+
   <!--
     Keybind actions are specified in labwc-actions(5)
     The following keybind modifiers are supported:
     <keybind key="XF86_MonBrightnessDown">
       <action name="Execute" command="brightnessctl set 10%-" />
     </keybind>
+    <!-- SnapToRegion via W-Numpad -->
+    <!--
+    <keybind key="W-KP_7"><action name="SnapToRegion" region="top-left" /></keybind>
+    <keybind key="W-KP_8"><action name="SnapToRegion" region="top" /></keybind>
+    <keybind key="W-KP_9"><action name="SnapToRegion" region="top-right" /></keybind>
+    <keybind key="W-KP_4"><action name="SnapToRegion" region="left" /></keybind>
+    <keybind key="W-KP_5"><action name="SnapToRegion" region="center" /></keybind>
+    <keybind key="W-KP_6"><action name="SnapToRegion" region="right" /></keybind>
+    <keybind key="W-KP_1"><action name="SnapToRegion" region="bottom-left" /></keybind>
+    <keybind key="W-KP_2"><action name="SnapToRegion" region="bottom" /></keybind>
+    <keybind key="W-KP_3"><action name="SnapToRegion" region="bottom-right" /></keybind>
+    -->
   </keyboard>
 
   <!--