Revert back accidentally removed {layout} placeholder

...and also rewrite the first sentence in the related paragraph in
README and NEWS - there are more placeholders that support formatting
than those that do not.  It would have been clear from the diff if
these files weren't wrapped...

I accidentally removed it in commit
cae756bab8.
timeout_old
Jakub Jirutka 2 years ago
parent b2913f2b9e
commit 3a81295859
  1. 8
      NEWS.md
  2. 22
      README.md
  3. 1
      src/tree.rs

@ -1,10 +1,10 @@
swayr v0.13.0
=============
- The placeholders `{id}`, `{app_name}`, `{name}`/`{title}`, `{output_name}`,
`{workspace_name}`, and `{marks}` may optionally provide a format string as
specified by [Rust's std::fmt](https://doc.rust-lang.org/std/fmt/). The
syntax is `{<placeholder>:<fmt_str><clipped_str>}`. For example,
- All the placeholders except `{app_icon}`, `{indent}`, `{urgency_start}`, and
`{urgency_end}` may optionally provide a format string as specified by
[Rust's std::fmt](https://doc.rust-lang.org/std/fmt/). The syntax is
`{<placeholder>:<fmt_str><clipped_str>}`. For example,
`{app_name:{:>10.10}}` would mean that the application name is printed with
exactly 10 characters. If it's shorter, it will be right-aligned (the `>`)
and padded with spaces, if it's longer, it'll be cut after the 10th

@ -324,17 +324,17 @@ right now.
* `fallback_icon` is a path to some PNG/SVG icon which will be used as
`{app_icon}` if no application-specific icon can be determined.
The placeholders `{id}`, `{app_name}`, `{name}`/`{title}`, `{output_name}`,
`{workspace_name}`, and `{marks}` may optionally provide a format string as
specified by [Rust's std::fmt](https://doc.rust-lang.org/std/fmt/). The syntax
is `{<placeholder>:<fmt_str><clipped_str>}`. For example,
`{app_name:{:>10.10}}` would mean that the application name is printed with
exactly 10 characters. If it's shorter, it will be right-aligned (the `>`) and
padded with spaces, if it's longer, it'll be cut after the 10th character.
Another example, `{app_name:{:.10}...}` would mean that the application name is
truncated at 10 characters. If it's shorter, it will be printed as-is (no
padding), if it's longer, it'll be cut after the 10th character and the last
3 characters of that substring will be replaced with `...` (`<clipped_str>`).
All the placeholders except `{app_icon}`, `{indent}`, `{urgency_start}`, and
`{urgency_end}` may optionally provide a format string as specified by
[Rust's std::fmt](https://doc.rust-lang.org/std/fmt/). The syntax is
`{<placeholder>:<fmt_str><clipped_str>}`. For example, `{app_name:{:>10.10}}`
would mean that the application name is printed with exactly 10 characters. If
it's shorter, it will be right-aligned (the `>`) and padded with spaces, if
it's longer, it'll be cut after the 10th character. Another example,
`{app_name:{:.10}...}` would mean that the application name is truncated at 10
characters. If it's shorter, it will be printed as-is (no padding), if it's
longer, it'll be cut after the 10th character and the last 3 characters of that
substring will be replaced with `...` (`<clipped_str>`).
It is crucial that during selection (using wofi or some other menu program)
each window has a different display string. Therefore, it is highly

@ -516,6 +516,7 @@ impl DisplayFormat for DisplayNode<'_> {
let value = match &caps["name"] {
"id" => self.node.id.to_string(),
"app_name" => self.node.get_app_name().to_string(),
"layout" => format!("{:?}", self.node.layout),
"name" | "title" => self.node.get_name().to_string(),
"output_name" => self
.tree

Loading…
Cancel
Save