diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-14 19:10:29 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-14 19:10:29 -0500 |
commit | 18b4959578cf96ed2eada6b3327f25b09eb1853a (patch) | |
tree | fb469ff34a1ba6c5fffc242464acd10f5235ebca /sway/config.c | |
parent | 0b5c695d8e90db409476f83515f193d1b3f4d48a (diff) | |
parent | 0513322c033d0d2c9c7aafaa95590c4d9320fcc8 (diff) |
Merge pull request #322 from mikkeloscar/default-bar-config
Move default bar config to bar creation.
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/sway/config.c b/sway/config.c index 2c2cc025..1302faa8 100644 --- a/sway/config.c +++ b/sway/config.c @@ -132,19 +132,6 @@ static void config_defaults(struct sway_config *config) { config->edge_gaps = true; config->gaps_inner = 0; config->gaps_outer = 0; - - // Bar - config->bar.mode = "dock"; - config->bar.hidden_state = "hide"; - config->bar.modifier = 0; - config->bar.position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM; - config->bar.status_command = "while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done"; - config->bar.font = "monospace 10"; - config->bar.bar_height = -1; - config->bar.workspace_buttons = true; - config->bar.strip_workspace_numbers = false; - config->bar.binding_mode_indicator = true; - config->bar.tray_padding = 2; } static char *get_config_path(void) { @@ -546,3 +533,23 @@ void free_sway_mouse_binding(struct sway_mouse_binding *binding) { } free(binding); } + +struct bar_config *default_bar_config(void) { + struct bar_config *bar = NULL; + bar = malloc(sizeof(struct bar_config)); + bar->mode = strdup("dock"); + bar->hidden_state = strdup("hide"); + bar->modifier = 0; + bar->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM; + bar->bindings = create_list(); + bar->status_command = strdup("while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done"); + bar->font = strdup("monospace 10"); + bar->bar_height = -1; + bar->workspace_buttons = true; + bar->strip_workspace_numbers = false; + bar->binding_mode_indicator = true; + bar->tray_padding = 2; + list_add(config->bars, bar); + + return bar; +} |