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:
committed by
Michael Stapelberg
parent
e2f47ef466
commit
e707e0a5fa
@ -517,6 +517,10 @@ CFGFUN(bar_workspace_buttons, const char *value) {
|
||||
current_bar.hide_workspace_buttons = !eval_boolstr(value);
|
||||
}
|
||||
|
||||
CFGFUN(bar_strip_workspace_numbers, const char *value) {
|
||||
current_bar.strip_workspace_numbers = eval_boolstr(value);
|
||||
}
|
||||
|
||||
CFGFUN(bar_finish) {
|
||||
DLOG("\t new bar configuration finished, saving.\n");
|
||||
/* Generate a unique ID for this bar if not already configured */
|
||||
|
@ -514,6 +514,9 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
|
||||
ystr("workspace_buttons");
|
||||
y(bool, !config->hide_workspace_buttons);
|
||||
|
||||
ystr("strip_workspace_numbers");
|
||||
y(bool, config->strip_workspace_numbers);
|
||||
|
||||
ystr("binding_mode_indicator");
|
||||
y(bool, !config->hide_binding_mode_indicator);
|
||||
|
||||
|
Reference in New Issue
Block a user