mirror of
https://github.com/swaywm/sway.git
synced 2026-04-27 06:46:25 -04:00
Add workspace_buttons_all_outputs command
Add a bar command that makes it so all workspaces are shown, even the ones that do not belong to the bar's output.
This commit is contained in:
parent
8441711990
commit
2b7454ca22
11 changed files with 47 additions and 1 deletions
|
|
@ -35,6 +35,7 @@ struct swaybar_config *init_config(void) {
|
|||
config->binding_mode_indicator = true;
|
||||
config->wrap_scroll = false;
|
||||
config->workspace_buttons = true;
|
||||
config->workspace_buttons_all_outputs = true;
|
||||
config->bindings = create_list();
|
||||
wl_list_init(&config->outputs);
|
||||
config->status_padding = 1;
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ static bool ipc_parse_config(
|
|||
}
|
||||
json_object *markup, *mode, *hidden_state, *position, *status_command;
|
||||
json_object *font, *gaps, *bar_height, *wrap_scroll, *workspace_buttons;
|
||||
json_object *workspace_buttons_all_outputs;
|
||||
json_object *strip_workspace_numbers, *strip_workspace_name;
|
||||
json_object *binding_mode_indicator, *verbose, *colors, *sep_symbol;
|
||||
json_object *outputs, *bindings, *status_padding, *status_edge_padding;
|
||||
|
|
@ -187,6 +188,8 @@ static bool ipc_parse_config(
|
|||
json_object_object_get_ex(bar_config, "bar_height", &bar_height);
|
||||
json_object_object_get_ex(bar_config, "wrap_scroll", &wrap_scroll);
|
||||
json_object_object_get_ex(bar_config, "workspace_buttons", &workspace_buttons);
|
||||
json_object_object_get_ex(bar_config, "workspace_buttons_all_outputs",
|
||||
&workspace_buttons_all_outputs);
|
||||
json_object_object_get_ex(bar_config, "strip_workspace_numbers", &strip_workspace_numbers);
|
||||
json_object_object_get_ex(bar_config, "strip_workspace_name", &strip_workspace_name);
|
||||
json_object_object_get_ex(bar_config, "binding_mode_indicator", &binding_mode_indicator);
|
||||
|
|
@ -229,6 +232,10 @@ static bool ipc_parse_config(
|
|||
if (workspace_buttons) {
|
||||
config->workspace_buttons = json_object_get_boolean(workspace_buttons);
|
||||
}
|
||||
if (workspace_buttons_all_outputs) {
|
||||
config->workspace_buttons_all_outputs =
|
||||
json_object_get_boolean(workspace_buttons_all_outputs);
|
||||
}
|
||||
if (bar_height) {
|
||||
config->height = json_object_get_int(bar_height);
|
||||
}
|
||||
|
|
@ -383,7 +390,8 @@ bool ipc_get_workspaces(struct swaybar *bar) {
|
|||
|
||||
wl_list_for_each(output, &bar->outputs, link) {
|
||||
const char *ws_output = json_object_get_string(out);
|
||||
if (strcmp(ws_output, output->name) == 0) {
|
||||
if (strcmp(ws_output, output->name) == 0 ||
|
||||
bar->config->workspace_buttons_all_outputs) {
|
||||
struct swaybar_workspace *ws =
|
||||
calloc(1, sizeof(struct swaybar_workspace));
|
||||
ws->num = json_object_get_int(num);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue