summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2025-02-11 18:06:19 +0100
committerFurkan Sahin <furkan-dev@proton.me>2025-02-11 18:06:19 +0100
commite8c910f2aee602706cc1f6aec1af80f9e50c622d (patch)
tree42bb87056f21d8e789a9dc9616ec387afa8fef0a
parentfaed8484c4e2cf9171b5fff1e4a449bcfc8f9930 (diff)
man: clarify criteria (incl. PCRE2 usage)
Replace the XWayland-only class attribute in the examples: - The first example given should work for Wayland-native windows. - The example 'Kill all windows with the title "Emacs"' should use title, not class. Also, it's a substring (regex) match. There are many different implementations of regular expressions with incompatible syntax. For example, GNU grep alone provides three different ones. Clarify the use of PCRE2 by sway criteria.
-rw-r--r--sway/sway.5.scd16
1 files changed, 13 insertions, 3 deletions
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index f580b2af..9bc03c9d 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -972,7 +972,7 @@ The default colors are:
A criteria is a string in the form of, for example:
```
-[class="[Rr]egex.*" title="some title"]
+[app_id="some-application" title="[Rr]egex.*"]
```
The string contains one or more (space separated) attribute/value pairs. They
@@ -992,10 +992,19 @@ Focus on a window with the mark "IRC":
[con_mark="IRC"] focus
```
-Kill all windows with the title "Emacs":
+Kill all windows where the title contains "Emacs":
```
-[class="Emacs"] kill
+[title="Emacs"] kill
+```
+
+Several attributes allow regular expressions. These use Perl-compatible regular
+expressions (PCRE2), which are documented in *pcre2pattern*(3) and summarized in
+*pcre2syntax*(3). For example, this moves all windows with titles ending in
+"sway" or "Sway" to workspace 1:
+
+```
+[title="[Ss]way$"] move workspace 1
```
You may like to use swaymsg -t get_tree for finding the values of these
@@ -1094,3 +1103,4 @@ The following attributes may be matched with:
# SEE ALSO
*sway*(1) *sway-input*(5) *sway-output*(5) *sway-bar*(5) *sway-ipc*(7)
+*pcre2pattern*(3) *pcre2syntax*(3)