Commit graph

96 commits

Author SHA1 Message Date
tokyo4j
2ac48116e1 action: allow SnapToEdge to combine two cardinal directions
This patch adds `combine` argument to (Toggle)SnapToEdge actions.
This allows to snap a window to e.g. up-left by running two actions:
- `<action name="SnapToEdge" direction="left" combine="yes" />`
- `<action name="SnapToEdge" direction="up" combine="yes" />`

Then running `<action name="SnapToEdge" direction="down" combine="yes" />`
snaps it to left again. This behavior is almost the same as KWin, except
that snapping a up-right-tiled window to right doesn't move it to the
right-adjacent output, but makes it right-tiled first.
2025-09-19 16:23:23 +09:00
cunlem
c6503e299f Update labwc-actions.5.scd
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-09-16 20:27:02 +01:00
Rainer Kuemmerle
657c08aaa1 action: add toggle for GoToDesktop
Adds an option "toogle" to GoToDesktop.
In case the target is already where we are, we go back to the last desktop
instead.

Example of rc.xml

<keybind key="C-F1">
  <action name="GoToDesktop">
    <to>1</to>
    <toggle>yes</toggle>
  </action>
</keybind>
2025-08-26 21:03:06 +01:00
Johan Malm
8a5a04cc1a labwc-action(5): describe If action <prompt> 2025-08-09 10:44:03 +01:00
tokyo4j
2f183cdcb6 interactive: allow snapping to corner edges
In addition to <snapping><range>, <snapping><cornerRange> configures the
distance from the screen corner to trigger quater window snapping.

Also, new values "up-left", "up-right", "down-left" and "down-right" are
allowed for <action name="(Toggle)SnapToEdge" direction="[value]"> and
<query tiled="[value]">.
2025-08-04 21:24:12 +01:00
tokyo4j
024ab280a0 cursor: also toggle mousebinds with ToggleKeybinds
Mousebinds can still be applied when the cursor is over their decoration
2025-07-28 00:06:52 +09:00
lynxy
13ff64f6e4 actions: added query tiled=any comparison for rc.xml simplification 2025-07-19 12:29:55 +09:00
DreamMaoMao
614c008bea feat: add left-occupied and right-occupied to workspaces_find 2025-06-06 18:35:32 +02:00
Johan Malm
2265dd647a labwc-actions(5): add example for ShowMenu with wtype
Related-to: #2726
2025-05-21 12:44:21 +02:00
Jens Peters
32585cce7e docs: document scroll wheel emulation actions 2025-05-07 03:47:37 +09:00
Tomi Ollila
2404297f2d docs: labwc-actions.5.scd style updates
- some newlines to dedent and separate content
- comma (,) before respectively
- reflowd some lines to fit in 80 columns
2025-03-31 21:26:56 +01:00
Jens Peters
d6edb8b273 action: Add HideCursor action 2025-03-24 21:23:55 +00:00
tokyo4j
713b1d8a13 osd: make window switcher more Openbox-like in terms of key precessing
Before this commit, keystrokes were interpreted based on following
hard-coded rules while the window switcher is active:

  1. Up/Left arrow keys cycle the window forward.
  2. Down/Right arrow keys cycle the window backward.
  3. Other keystrokes cycle the window in the initial direction specified
     by NextWindow/PreviousWindow actions. But while Shift key is pressed,
     the direction is inverted.

...and keybind actions were never executed.

However, this lead to a counter-intuitive behavior for new, especially
pre-Openbox users. For example, in the following keybinds, after the user
activates the window switcher with Super+n, Super+p cycles the window
_forward_:

  <keybind key="W-n">
    <action name="NextWindow" />
  </keybind>
  <keybind key="W-p">
    <action name="PreviousWindow" />
  </keybind>

This is because the key 'n' is recognized just as a normal key in the
third hard-coded rule.

So this commit changes the rules to be more Openbox-like:

  1. Up/Left arrow keys cycles the window forward.
  2. Down/Right arrow keys cycles the window backward.
  3. Other keystrokes are matched against keybinds and execute their
     actions. If they include NextWindow/PreviousWindow action, it cycles
     the selected window forward/backward even while the window switcher
     is active.
2025-01-03 10:51:26 +09:00
Orfeas
1550eb9c26 action: add WarpCursor action 2024-12-26 10:27:02 +00:00
Johan Malm
08de4f3d6b labwc-actions(5): add missing position option to ShowMenu 2024-12-15 01:07:24 +01:00
Orfeas
f4c270c92f query: extend "monitor" query & add missing docs 2024-12-14 20:28:16 +00:00
Andrew J. Hesford
14aad38a2c query: fix three-state-parameter parsing, simplify match logic
Fixes: #2288.
2024-11-01 12:52:10 -04:00
Orfeas
96da82c085 query: support additional conditions for matching clients
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>

Closes: #2245.
2024-10-30 14:30:26 -04:00
Jens Peters
b9414d8b8d action: implicitely unmaximize when unsnapping
Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
694c5a7469 action: add UnSnap action
Same untiling behavior as ToggleSnapToEdge/Region,
but unconditionally.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
cb2e2c1016 action: add ToggleSnapToEdge/Region actions
Behaves identical like SnapToEdge and SnapToRegion, but
untiles the window when already being tiled to the given
region or direction.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
tokyo4j
d29464bac7 docs: fix documentation of "atCursor" for dynamic titlebar layout 2024-09-21 14:15:16 +01:00
Droc
4a1375c701 client send to menu
Shows all workspaces that current view can be sent to.
Works best when added to Client menu.

<menu id="client-send-to-menu" label="Send to..." />

Menu uses ">" and "<"  to highlight the current workspace
2024-09-19 06:36:27 +01:00
Droc
71b2b5a4bc menu: support client-list-combined-menu
...showing windows across all workspaces.

<action name="ShowMenu" menu="client-list-combined-menu"/>
2024-09-17 22:13:23 +01:00
Droc
8850368ab9 Add position arguments for menus
...utilizing x,y coordinates where values can be a number, a negative
number, a percentage or "center".

- (0,0) is top left corner
- (-0,-0) is bottom right corner
- % is percentage of width and/or height
- 'center' centers the menu vertically and/or horizontally

    <action name="ShowMenu">
      <menu>root-menu</menu>
      <position>
        <x>0</x>
        <y>0</y>
      </position>
    </action>

Note: both x and y values must be supplied for positioning to work.
2024-09-05 22:28:50 +02:00
Orfeas
dda47a5e14 action: make "FocusOutput" behave like "MoveToOutput" 2024-08-24 14:59:42 -04:00
Jens Peters
cd961b1ac1 action: add Enable/DisableTabletMouseEmulation
Useful for window rules.
2024-08-20 21:45:59 +01:00
Jens Peters
433a4509af
tearing: add fullscreen options (#1941)
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2024-08-06 21:23:10 +01:00
tokyo4j
46ec513630 view: implement cascade placement policy
Adds following settings:
<placement>
  <policy>cascade</policy>
  <cascadeOffset x="40" y="30" />
</placement>

"Cascade" policy places a new window at the center of the screen like
"center" policy, but possibly shifts its position to bottom-right so the
new window doesn't cover existing windows.

The algorithm is copied from KWin's implementation:
df9f8f8346/src/placement.cpp (L589)

Also added some helper functions to manipulate `wlr_box`.
2024-07-20 08:59:46 +01:00
droc12345
f2755a4e2e
action: remember initial direction of PreviousView
...when cycling windows. Also make the toggling of direction when shift
is pressed relative to the initial direction. For example if W-j is
bound to PreviousWindow, subsequent key presses will continue to
cycle backwards unless shift if pressed.

Add documentation for using shift/arrow keys in Next/Previous
2024-06-26 22:03:56 +01:00
Jens Peters
b63c6a0fc2 action: add ToggleTabletMouseEmulation
Useful for switching between application-defined and
mapped tablet  pad buttons. Also for quickly troubleshooting
tablet behavior.
2024-06-18 22:13:28 +01:00
Johan Malm
b1b48537a1 Add action UnMaximize
Suggested-by: @Vladimir-csp

Fixes: #1825
2024-05-27 21:02:31 +01:00
Tobias Bengfort
41a3b68846 decorations: add SetDecorations action 2024-05-19 19:03:42 +01:00
Johan Malm
bab1be834d Deprecate MoveToCursor
Use <action name="AutoPlace" policy="cursor"/> instead.

Related-to: #1785
Suggested-by: @tokyo4j
2024-05-19 19:57:20 +02:00
Andrew J. Hesford
89589f17c4 action: allow configurable policy in AutoPlace action
Closes: #1784.
2024-05-19 17:32:52 +01:00
Tobias Bengfort
7bc3cae91a query: add window type filter for if-actions 2024-05-18 20:04:08 +01:00
Simon Long
8ba066a1a5
Add screen magnifier
This adds a screen magnifier which can be controlled with the
`ZoomIn` / `ZoomOut` and `ToggleMagnify` actions.

It scales up part of the rendered framebuffer so the magnification
may end up looking blurry depending on the magnification scale.

PR #1774
2024-05-16 00:07:23 +02:00
Tomi Ollila
2e2cf54c00 docs: Fixed some typos, 80 column lines (where possible) 2024-04-26 22:15:39 +01:00
Consolatis
1f39f17be1 docs: add missing documention for the ForEach none branch 2024-04-14 13:27:18 +02:00
Tomi Ollila
6e7f1b430f docs: 80 column lines (where possible), drop trailing whitespace
with one typofix
2024-04-07 21:54:42 +02:00
Andrew J. Hesford
cdac800692 action: allow client-menu to open at mouse cursor 2024-03-13 10:51:50 -04:00
Consolatis
983ca66d07 src/action.c: fix MoveToOutput action by renaming 'name' argument
We were using the argument name 'name' before
which is already used by the action itself:
`<action name="MoveToOutput" name="HDMI-A-1" />`

Change the argument name to "output" which also
matches the `FocusOutput` action.

Fixes: #1589
Reported-by: @bnason (thanks!)
2024-03-06 18:34:56 +00:00
Johan Malm
3c3bcc2765 view: add MoveToOutput wrap attribute
Support `wrap` in view_get_adjacent_output(). This means that when seeking
an adjacent output in a particular direction from an output that is
already furthest in that direction within the layout, rather than
returning NULL, wrap around from the leftmost to the rightmost, or topmost
to the bottommost and vice versa.

Example usage:

    <action name="MoveToOutput" direction="right" wrap="yes" />

Wrap is disabled by default to keep the user interface consistent.
2024-03-02 21:23:01 +00:00
Jens Peters
945eea8f27 docs: describe MoveToOutput/FitToOutput action 2024-01-22 22:27:08 +00:00
Consolatis
e05bedb140 feat: add Shade/Unshade/ToggleShade actions
This builds on the work of @Consolatis in #1018.

Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-01-15 21:37:36 +00:00
Tomi Ollila
42afdf9193 Fixed some typos, whitespace, periods, 80-column lines
- typos: LINGUAS manually, rest with help of aspell(1)
- whitespace: some trailing spaces/tabs, one utf-8 NBSP (#xC2 #xA0)
- made most text in docs/ fit in max 80-column wide lines
- consistent trailing periods in sentences in labwc-actions.5.scd and
  labwc-config.5.scd; labwc-theme.5.scd had different consistency,
  changed it follow these other files with sentence-ending periods
- and ", respectively" (comma often used to separate)
2024-01-13 19:05:50 +00:00
Ph42oN
bce0c6ce56
Add tearing support (#1390)
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-01-08 20:58:58 +00:00
Tomi Ollila
785a34e8ad Fixed some typos 2024-01-04 19:32:51 +00:00
Andrew J. Hesford
e3cd189769 feat: add "AutoPlace" action
The AutoPlace action will apply placement_find_best() to an active view,
moving it to a position on its output that will minimize overlap with
other views.
2023-12-28 22:09:44 +00:00
kyak
111b955b53
Implement key binds to control virtual outputs (#1287)
Add actions `VirtualOutputAdd` and `VirtualOutputRemove`
2023-12-09 09:01:11 +00:00