diff --git a/README.md b/README.md index 6d89f61..161441f 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ playerctl metadata --format "Volume: {{ volume * 100 }}" | `markup_escape` | string | Escape XML markup characters in the string. | | `default` | any, any | Print the first value if it is present, or else print the second. | | `emoji` | status or volume | Try to convert the variable to an emoji representation. | +| `trunc` | string, int | Truncate string to a maximum length. | | Variable | Description | | ------------ | ------------------------------------------------- | diff --git a/doc/playerctl.1.in b/doc/playerctl.1.in index 87e7810..31d60dc 100644 --- a/doc/playerctl.1.in +++ b/doc/playerctl.1.in @@ -251,6 +251,12 @@ to an emoji representation. Currently implemented for .Fa status and .Fa volume . +.It Fn trunc str len +Truncate +.Fa str +to a maximum of +.Fa len +characters, adding an ellipsis (…) if necessary. .El .Pp The template language is also able to perform basic math operations.