diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2015-12-15 00:35:18 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2015-12-15 01:05:00 +0100 |
commit | 0513322c033d0d2c9c7aafaa95590c4d9320fcc8 (patch) | |
tree | fb469ff34a1ba6c5fffc242464acd10f5235ebca /sway/commands.c | |
parent | 0b5c695d8e90db409476f83515f193d1b3f4d48a (diff) |
Move default bar config to bar creation.
Get rid of `config->bar` and define the default bar config options when
a bar is initialized.
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sway/commands.c b/sway/commands.c index 053f40fc..d2499e28 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -1126,22 +1126,8 @@ static struct cmd_results *cmd_bar(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, "bar", "Can only be used in config file."); } - // Create new bar from default bar config - struct bar_config *bar = NULL; - bar = malloc(sizeof*bar); - bar->mode = strdup(config->bar.mode); - bar->hidden_state = strdup(config->bar.hidden_state); - bar->modifier = config->bar.modifier; - bar->position = config->bar.position; - bar->bindings = create_list(); - bar->status_command = strdup(config->bar.status_command); - bar->font = strdup(config->bar.font); - bar->bar_height = config->bar.bar_height; - bar->workspace_buttons = config->bar.workspace_buttons; - bar->strip_workspace_numbers = config->bar.strip_workspace_numbers; - bar->binding_mode_indicator = config->bar.binding_mode_indicator; - bar->tray_padding = config->bar.tray_padding; - list_add(config->bars, bar); + // Create new bar with default values + struct bar_config *bar = default_bar_config(); // set bar id int i; |