i3bar: implement custom workspace numbers config

Implement the configuration option within the bar config directive for
custom workspace numbers with the directive `strip_workspace_numbers
yes`.

This directive strips the workspace name of the number prefix and
delimiter. When the workspace name consists only of the number, it will
default to show the number.

For example:

* "2:5" -> "5"
* "4:$" -> "$"
* "8" -> "8"

This allows customization of i3bar for alternate ordering of workspaces
which has a legitimate use for alternate keyboard layouts such as
Dvorak.

fixes #1131
This commit is contained in:
Tony Crisci
2014-05-05 13:56:47 -04:00
committed by Michael Stapelberg
parent e2f47ef466
commit e707e0a5fa
12 changed files with 81 additions and 6 deletions

View File

@ -1191,6 +1191,31 @@ bar {
}
------------------------
=== Strip workspace numbers
Specifies whether workspace numbers should be displayed within the workspace
buttons. This is useful if you want to have a named workspace that stays in
order on the bar according to its number without displaying the number prefix.
When +strip_workspace_numbers+ is set to +yes+, any workspace that has a name of
the form "[n]:[NAME]" will display only the name. You could use this, for
instance, to display Roman numerals rather than digits by naming your
workspaces to "1:I", "2:II", "3:III", "4:IV", ...
The default is to display the full name within the workspace button.
*Syntax*:
----------------------------------
strip_workspace_numbers <yes|no>
----------------------------------
*Example*:
----------------------------
bar {
strip_workspace_numbers yes
}
----------------------------
=== Binding Mode indicator
Specifies whether the current binding mode indicator should be shown or not.