aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/criteria.h
Commit message (Collapse)AuthorAge
* Introduce pid criteria tokenLibravatar Ryan Dwyer2020-02-27
| | | | | | | | | | This can be used as a workaround to flag terminal windows as urgent when commands are completed, until urgency is introduced in the Wayland protocol. Configure your shell to run `swaymsg "[pid=$PPID] urgent enable"` when commands are completed, and use a terminal which uses one process per window.
* criteria: match containers without viewLibravatar Anders2020-02-04
| | | | | | | | Closes #4929 Replaces criteria_get_views with criteria_get_containers which can return containers without views when the criteria only contains container properties.
* criteria: make literal comparison for __focused__ valuesLibravatar Ronan Pigott2019-10-27
|
* Avoid adding duplicate criteria for no_focus and commandLibravatar Ashkan Kiani2019-07-27
|
* criteria: fix __focused__ when no focus or unsetLibravatar Brian Ashworth2019-03-23
| | | | | | | | | | | | | | | | | | | | | | | | This fixes the behavior of `__focused__` when there is no focused view to match i3's behavior of successfully matching no views instead of returning an error of a missing value. It also applies the same logic when a token is not applicable (or unset) for a view such as `app_id` for a focused xwayland view or `class` for a focused xdg-shell view. This adds an `autofail` boolean to `struct criteria`. If it is set to `true`, then `criteria_matches_view` will immediately bail out as a no match. If `autofail` is set, the criteria will also not be considered empty by `criteria_is_empty`. To set this new `autofail` property, `get_focused_prop` will now take in a boolean pointer of the same name. If `__focused__` is supported for the token and there is no focused view or the focused view does not have a value for the token, then the boolean will be set to true. In `parse_token`, the boolean value will be checked and if set to true, then `criteria->autofail` will be set to true and `parse_token` will bail successfully. Tokens will still be parsed to make sure the whole criteria is syntactically valid, which is also why `&criteria->autofail` is not passed to `get_focused_prop` and a local boolean is declared in `parse_token`.
* criteria: change workspace to support regexLibravatar Brian Ashworth2019-03-12
| | | | | This changes the workspace criteria to support regex instead of basic strings. This matches i3's behavior.
* Use #if instead of #ifdefLibravatar emersion2018-11-18
|
* move criteria "instance", "class" and "window_role" inside HAVE_XWAYLAND ifdefs"Libravatar Pascal Pascher2018-09-03
|
* Fixed window_type with disabled xwayland support.Libravatar Pascal Pascher2018-09-03
|
* Implement window_type criteria tokenLibravatar Ryan Dwyer2018-09-01
|
* commands: complete assign commandLibravatar Ian Fan2018-08-18
|
* reverted includes of "sway/config.h" and replaced with "config.h" from meson ↵Libravatar Pascal Pascher2018-07-25
| | | | build
* style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: falseLibravatar Pascal Pascher2018-07-24
|
* Added meson option "enable_xwayland" (default: true) to enable/disable ↵Libravatar Pascal Pascher2018-07-24
| | | | xwayland support
* Implement no_focus commandLibravatar Ryan Dwyer2018-07-16
|
* Add shell criteria tokenLibravatar Ryan Dwyer2018-05-27
| | | | Closes #2044.
* Revert "Revert "Merge pull request #1943 from RyanDwyer/criteria-improvements""Libravatar Ryan Dwyer2018-05-14
| | | | | | | This reverts commit 32a572cecfd0f6072a78ce0a381a2f8365f9010a. This reimplements the criteria overhaul in preparation for fixing a known bug.
* Revert "Merge pull request #1943 from RyanDwyer/criteria-improvements"Libravatar Drew DeVault2018-05-12
| | | | | This reverts commit 3e1bf721c69cb6df70c3dc3d3d4933e987339676, reversing changes made to 2217518bd554d0f11dafa7ec4e8f35f2e4762fbd.
* Overhaul criteria implementationLibravatar Ryan Dwyer2018-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The criteria struct now uses properties for each token type rather than the list_t list of tokens. The reason for this is that different token types have different data types: pcre, string and number to name a few. This solution should be more flexible moving forward. A bonus of this is that criteria is now easier to understand when looking at the struct definition. The criteria parser has been rewritten because the previous one didn't support valueless pairs (eg. [class="foo" floating]). Criteria now has types. Types at the moment are CT_COMMAND, CT_ASSIGN_WORKSPACE and CT_ASSIGN_OUTPUT. i3 uses types as well. Previously the assign command was creating a criteria with 'move to workspace <name>' as its command, but this caused the window to appear briefly on the focused workspace before being moved to the assigned workspace. It now creates the view directly in the assigned workspace. Each view will only execute a given criteria once. This is achieved by storing a list of executed criteria in the view. This is the same strategy used by i3. Escaping now works properly. Previously you could do things like [class="Fire\"fox"] and the stored value would be 'Fire\"fox', but it should be (and now is) 'Fire"fox'. The public functions in criteria.c are now all prefixed with criteria_. Xwayland views now listen to the set_title, set_class and set_window_type events and criteria will be run when these happen. XDG shell has none of these events so it continues to update the title in handle_commit. Each view type's get_prop function has been split into get_string_prop and get_int_prop because some properties like the X11 window ID and window type are numeric. The following new criteria tokens are now supported: * id (X11 window ID) * instance * tiling * workspace
* Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"Libravatar Tony Crisci2018-03-29
| | | | | This reverts commit 472e81f35d689d67cda241acafda91c688d61046, reversing changes made to 6b7841b11ff4cd35f54d69dc92029855893e5ce0.
* Revert "Refactor tree"Libravatar Drew DeVault2018-03-29
|
* remove swayc_t typedefLibravatar Tony Crisci2018-03-29
|
* move tree includes to their own directoryLibravatar Tony Crisci2018-03-29
|
* criteria cleanupLibravatar Tony Crisci2018-01-21
|
* basic command criteriaLibravatar Tony Crisci2018-01-20
|
* Move everything to sway/old/Libravatar Drew DeVault2017-11-18
|
* Implement no_focusLibravatar Drew DeVault2017-04-26
| | | | Ref #2
* Improve criteria handlingLibravatar Calvin Lee2017-04-05
| | | | | | | | | | | | | | This commit changes how commands decide what container to act on. Commands get the current container though `current_container`, a global defined in sway/commands.c. If a criteria is given before a command, then the following command will be run once for every container the criteria matches with a reference to the matching container in 'current_container'. Commands should use this instead of `get_focused_container()` from now on. This commit also fixes a few (minor) mistakes made in implementing marks such as non-escaped arrows in sway(5) and calling the "mark" command "floating" by accident. It also cleans up `criteria.c` in a few places.
* Reorganize includesLibravatar Drew DeVault2016-09-01