module/i3: add ‘strip-workspace-numbers’ option

This is a boolean option. When set, “N:” prefixes will be stripped
from the workspaces’ name tag, *after* having been sorted (if the
‘sort’ option is being used).

This makes it useful to arrange the workspaces in a fixed order, by
prefixing the names with a number in the Sway config:

  set $ws1 “1:xyz”
  set $ws2 “2:abc”

Then, in the yambar config:

  i3:
    sort: ascending
    strip-workspace-numbers: true
This commit is contained in:
Daniel Eklöf 2022-02-11 21:44:43 +01:00
parent 605490c872
commit a2cf05a64d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 34 additions and 5 deletions

View file

@ -68,6 +68,10 @@ with the _application_ and _title_ tags to replace the X11-only
: enum
: no
: How to sort the list of workspaces; one of _none_, _ascending_ or _descending_, defaults to _none_.
| strip-workspace-numbers
: bool
: no
: If true, *N:* prefixes will be stripped from workspace names. Useful together with *sort*, to have the workspace order fixed.
| persistent
: list of strings
: no