labwc-actions(5) | File Formats Manual | labwc-actions(5) |
NAME
labwc - actions
ACTIONS
Actions are used in menus and keyboard/mouse bindings.
<action name="Close" />
<action name="Kill" />
<action name="Execute" command="value" />
<action name="Exit" />
<action name="Focus" />
<action name="Unfocus" />
<action name="Raise" />
<action name="Lower" />
<action name="Iconify" />
<action name="Move" />
<action name="MoveToEdge" direction="value" snapWindows="value" />
direction [left|up|right|down] Direction in which to move.
snapWindows [yes|no] Move window until it hits an edge of another window or screen edge. If set to "no", only move to the next screen edge. Default is yes.
<action name="Resize" />
<action name="ResizeRelative" left="" right="" top="" bottom="" />
<action name="GrowToEdge" direction="value" />
direction [left|up|right|down] Direction in which to grow.
<action name="ShrinkToEdge" direction="value" />
direction [left|up|right|down] Direction in which to shrink.
<action name="MoveTo" x="" y="" />
<action name="ResizeTo" width="" height="" />
width The width to resize the window to in pixels.
height The height to resize the window to in pixels.
<action name="MoveToCursor" />
<action name="MoveRelative" x="" y="" />
<action name="ToggleSnapToEdge"
direction="value" />
<action name="SnapToEdge" direction="value"
/>
ToggleSnapToEdge additionally toggles the active window between tiled to the given direction and its untiled position.
<action name="ToggleSnapToRegion"
region="value" />
<action name="SnapToRegion" region="value"
/>
ToggleSnapToRegion additionally toggles the active window between tiled to the given region and its untiled position.
See labwc-config(5) for further information on how to define regions.
<action name="UnSnap" />
<action name="NextWindow" />
<action name="PreviousWindow" />
Default keybind for NextWindow is Alt-Tab.
The shift key is used to reverse direction while cycling.
The arrow keys are used to move forwards/backwards while cycling.
<action name="Reconfigure" />
<action name="ShowMenu" menu="value" atCursor="yes" />
menu The name of the menu to show. The menus "root-menu", "client-menu", "client-send-to-menu" and "client-list-combined-menu" are guaranteed to exist, but others may be defined explicitly. See labwc-menu(5) for more information.
atCursor [yes|no] When opening a menu, open the menu at the location of the mouse cursor. When set to no, the menu will appear at the upper-left corner of the window associated with the action or underneath the window button that opened the menu. Default is yes.
position Show the menu in the specified position on the monitor that has cursor focus, see below.
The position tag has two sub-tags. <x> and <y> specify a position and take either a pixel value, the string "center" which will center the menu in that dimension, or a relative value specified as a percentage A relative value is interpreted in terms of the monitor the menu will be shown on, and will be relative to the left/top edge of the menu window and monitor for positive values, and to the right/bottom edge for negative values.
<action name="SetDecorations" decorations="value" forceSSD="no" />
decorations [full|border|none] full enables the whole server side decorations. With border. only the borders and invisible resize area are enabled. none disables everything.
forceSSD [yes|no] If this is no, this action will be ignored for windows that have client side decorations if it would increase the amount of decoration. Default is no.
<action name="ToggleDecorations" />
This is a 3-state action which can be executed multiple times:
- Only the titlebar will be hidden, borders and resize area are kept
- Remaining decorations will be disabled
- Decorations will be shown normally
By disabling the theme configuration 'keepBorder' the first step will be removed and the action only toggles between on and off.
<action name="ToggleFullscreen" />
<action name="ToggleMaximize" direction="value" />
<action name="Maximize" direction="value" />
<action name="UnMaximize" direction="value" />
<action name="ToggleAlwaysOnTop" />
<action name="ToggleAlwaysOnBottom" />
<action name="ToggleOmnipresent" />
<action name="ToggleKeybinds" />
This action will only affect the window that had keyboard focus when the binding was executed. Thus when switching to another window, all the usual keybinds will function again until switching back to the original window. There can be multiple windows with this mode set.
<action name="ToggleTearing" />
Requires the config option 'allowTearing'. When 'allowTearing' is set to 'fullscreen' or 'fullscreenForced', tearing will still only be enabled if the active window is in fullscreen mode.
<action name="FocusOutput" output="HDMI-A-1" direction="value" wrap="no" />
If output is specified, the focus is given to the specified output and direction is ignored. If output is omitted, direction may be one of "left", "right", "up" or "down" to indicate that the focus should be given to the next output in that direction (if one exists).
wrap [yes|no] When using the direction attribute, wrap around from right-to-left or top-to-bottom, and vice versa. Default is no.
If the target output does not contain any windows, the cursor will be centered on the output.
<action name="MoveToOutput" output="HDMI-A-1" direction="value" wrap="no" />
If output is specified, the window will be sent directly to the specified output and direction is ignored. If output is omitted, direction may be one of "left", "right", "up" or "down" to indicate that the window should be moved to the next output in that direction (if one exists).
wrap [yes|no] When using the direction attribute, wrap around from right-to-left or top-to-bottom, and vice versa. Default no.
<action name="FitToOutput" />
<action name="GoToDesktop" to="value" wrap="yes" />
to The workspace to switch to. Supported values are "current", "last", "left", "right" or the full name of a workspace or its index (starting at 1) as configured in rc.xml.
wrap [yes|no] Wrap around from last desktop to first, and vice versa. Default yes.
<action name="SendToDesktop" to="value" follow="yes" wrap="yes" />
to The workspace to send the window to. Supported values are the same as for GoToDesktop.
follow [yes|no] Also switch to the specified workspace. Default yes.
wrap [yes|no] Wrap around from last desktop to first, and vice versa. Default yes.
<action name="VirtualOutputAdd" output_name="value" />
For example, it can be used to overlay virtual output on real output, but with a different resolution (this can be done with `wlr-randr` or `wdisplays`). After that, virtual output can be selected for screen sharing (casting), effectively sharing only the region of the screen.
It must be noted that overlaying virtual output and real output is not endorsed or explicitly supported by wlroots. For example, after configuring virtual output, real output must be reconfigured as well (for the overlay configuration to work correctly). This is the example configuration:
<keybind key="W-v"> <action name="VirtualOutputAdd" output_name="ScreenCasting"/> <action name="Execute" command='sh -c "wlr-randr --output ScreenCasting --pos 0,0 --scale 2 --custom-mode 3840x2110; wlr-randr --output eDP-1 --pos 0,0 --scale 2 --mode 3840x2160"'/> </keybind> <keybind key="W-c"> <action name="VirtualOutputRemove"/> </keybind>
Virtual output is also useful for extending the desktop to (maybe mobile) remote systems like tablets. E.g. simply adding a virtual output, attaching wayvnc to it and running a VNC client on the remote system.
output_name The name of virtual output. Providing virtual output name is beneficial for further automation. Default is "HEADLESS-X".
<action name="VirtualOutputRemove" output_name="value" />
output_name The name of virtual output. If not supplied, will remove the last virtual output added.
<action name="AutoPlace" policy="value"/>
policy [automatic|cursor|center|cascade] Use the specified policy, which has the same meaning as the corresponding value for <placement><policy>. Default is automatic.
<action name="Shade" />
<action name="Unshade" />
<action name="ToggleShade" />
<action name="EnableTabletMouseEmulation"
/>
<action name="DisableTabletMouseEmulation" />
<action name="ToggleTabletMouseEmulation">
<action name="ToggleMagnify">
<action name="ZoomIn">
<action name="ZoomOut">
<action name="None" />
CONDITIONAL ACTIONS
Actions that execute other actions. Used in keyboard/mouse bindings.
<action name="If">
The arguments are as follows:
<action name="If"> <query/> <then><action/></then> <else><action/></else> </action>
query
Pattern matching is done according to glob(7) and is case-insensitive.
Conditions are as follows:
identifier
title
type
shaded [yes|no]
maximized [both|horizontal|vertical|none]
iconified [yes|no]
focused [yes|no]
omnipresent [yes|no]
desktop
tiled [up|right|down|left|center]
tiled_region
decoration [full|border|none]
This argument is optional.
then
else
<action name="ForEach">
The ForEach action has another optional none branch which gets executed when no window has been matched by the query. This allows for example to implement a run-or-raise functionality.
SEE ALSO
labwc(1), labwc-config(5), labwc-theme(5), glob(7)
2024-12-26 |