]> git.mdlowis.com Git - proto/labwc.git/commitdiff
labwc-action(5): describe If action <prompt>
authorJohan Malm <jgm323@gmail.com>
Tue, 24 Jun 2025 19:44:32 +0000 (20:44 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 9 Aug 2025 09:44:03 +0000 (10:44 +0100)
docs/labwc-actions.5.scd
docs/menu.xml

index fa38698a378754676b005293d48ac7433b1b82be..7aa78507ba55c68bfb6e9c87998afe22d43980c9 100644 (file)
@@ -423,6 +423,7 @@ Actions that execute other actions. Used in keyboard/mouse bindings.
        ```
        <action name="If">
          <query/>
+         <prompt message=""/>
          <then><action/></then>
          <else><action/></else>
        </action>
@@ -494,6 +495,26 @@ Actions that execute other actions. Used in keyboard/mouse bindings.
 
                This argument is optional.
 
+       *prompt*
+               Display a yes/no prompt dialog (labnag by default). If 'yes' is
+               selected, the *then* branch will be taken; and similarly with
+               'no' and *else*. This argument is optional. Note that the syntax
+               is different to that of Openbox where a prompt element is not
+               tied to If-actions but would just be a child of the downstream
+               action. The reason for this difference is increased flexibility
+               and functionality gained by optionally using an *else* branch.
+
+               ```
+               <keybind key="W-q">
+                 <action name="If">
+                   <prompt message="Quit?"/>
+                   <then>
+                     <action name="Exit"/>
+                   </then>
+                 </action>
+               </keybind>
+               ```
+
        *then*
                A list of actions to be executed if the window matches any
                query. This argument is optional.
index d1ea8607780381d30a6ba56fe7347a15b964b37b..536d63a428dd257826531105382e14d74ed202e7 100644 (file)
   <item label="Exit">
     <action name="Exit" />
   </item>
+  <!--
+  # A prompt can be used as follows:
+  <item label="Exit">
+    <action name="If"/>
+      <prompt message="Do you really want to exit the compositor?"/>
+      <then>
+        <action name="Exit"/>
+      </then>
+  </item>
+  -->
 </menu>
 
 <menu id="some-custom-menu">