Age | Commit message (Collapse) | Author |
|
|
|
Implements the following commands:
* move scratchpad
* scratchpad show
* [criteria] scratchpad show
Also fixes these:
* Fix memory leak when executing command with criteria
(use `list_free(views)` instead of `free(views)`)
* Fix crash when running `move to` with no further arguments
|
|
Also free cmd_list when cleaning up a struct criteria.
|
|
Introduces a command to manually set urgency, as well as rendering of
urgent views, sending the IPC event, removing urgency after focused for
one second, and matching urgent views via criteria.
|
|
|
|
|
|
|
|
|
|
|
|
Closes #2044.
|
|
|
|
|
|
|
|
This reverts commit ac0e62584f6101277b76622a7274866cd50f615c.
This reimplements the criteria __focused__ commit in preparation for
fixing a known bug.
|
|
This reverts commit 32a572cecfd0f6072a78ce0a381a2f8365f9010a.
This reimplements the criteria overhaul in preparation for fixing a
known bug.
|
|
This reverts commit 3e1bf721c69cb6df70c3dc3d3d4933e987339676, reversing
changes made to 2217518bd554d0f11dafa7ec4e8f35f2e4762fbd.
|
|
This reverts commit 2511adffc29996b64d01d85b3de31de9a2af9096, reversing
changes made to 3e1bf721c69cb6df70c3dc3d3d4933e987339676.
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
This reverts commit 472e81f35d689d67cda241acafda91c688d61046, reversing
changes made to 6b7841b11ff4cd35f54d69dc92029855893e5ce0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sometimes it doesn't really make sense to quote them (numeric values for
example)
In that case, the value is parsed until the next space or the end of the
whole criteria expression
|
|
* con_id
* floating
* tiling
|
|
Increase _POSIX_SOURCE value where needed.
Increase _XOPEN_SOURCE value where needed.
Conditionally link to libcap (only on Linux).
Possibly some trailing whitespace fixes (automatic).
|
|
Ref #2
|
|
ordering
|
|
|
|
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.
|
|
This commit adds three commands to sway: `show_marks`, `mark` and
`unmark`. Marks are displayed right-aligned in the window border as i3
does. Marks may be found using criteria.
Fixes #1007
|
|
|
|
Support __focused__ as a valid criterion
|
|
This reflects i3 behavior (see i3/i3#1770)
Scrapping focused support will probably break some existing configs
|
|
|
|
|
|
|
|
A criteria is a string in the form of `[class="regex.*" title="str"]`.
It is stored in a struct with a list of *tokens* which is a
attribute/value pair (stored as a `crit_token` struct). Most tokens will
also have a precompiled regex stored that will be used during criteria
matching.
for_window command: When a new view is created its metadata is tested
against all stored criteria, and if a match is found the associated
command list is executed.
Unfortunately some metadata is not available in sway at the moment
(specifically `instance`, `window_role` and `urgent`). Any criteria
string that tries to match an unsupported attribute will fail.
(Note that while the criteria code can be used to parse any criteria
string it is currently only used by the `for_window` command.)
|