summaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-15 00:35:18 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-15 01:05:00 +0100
commit0513322c033d0d2c9c7aafaa95590c4d9320fcc8 (patch)
treefb469ff34a1ba6c5fffc242464acd10f5235ebca /sway/config.c
parentMerge pull request #321 from gpyh/bar_cmds (diff)
downloadsway-0513322c033d0d2c9c7aafaa95590c4d9320fcc8.tar.gz
sway-0513322c033d0d2c9c7aafaa95590c4d9320fcc8.tar.zst
sway-0513322c033d0d2c9c7aafaa95590c4d9320fcc8.zip
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/config.c')
-rw-r--r--sway/config.c33
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) {
132 config->edge_gaps = true; 132 config->edge_gaps = true;
133 config->gaps_inner = 0; 133 config->gaps_inner = 0;
134 config->gaps_outer = 0; 134 config->gaps_outer = 0;
135
136 // Bar
137 config->bar.mode = "dock";
138 config->bar.hidden_state = "hide";
139 config->bar.modifier = 0;
140 config->bar.position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
141 config->bar.status_command = "while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done";
142 config->bar.font = "monospace 10";
143 config->bar.bar_height = -1;
144 config->bar.workspace_buttons = true;
145 config->bar.strip_workspace_numbers = false;
146 config->bar.binding_mode_indicator = true;
147 config->bar.tray_padding = 2;
148} 135}
149 136
150static char *get_config_path(void) { 137static char *get_config_path(void) {
@@ -546,3 +533,23 @@ void free_sway_mouse_binding(struct sway_mouse_binding *binding) {
546 } 533 }
547 free(binding); 534 free(binding);
548} 535}
536
537struct bar_config *default_bar_config(void) {
538 struct bar_config *bar = NULL;
539 bar = malloc(sizeof(struct bar_config));
540 bar->mode = strdup("dock");
541 bar->hidden_state = strdup("hide");
542 bar->modifier = 0;
543 bar->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
544 bar->bindings = create_list();
545 bar->status_command = strdup("while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done");
546 bar->font = strdup("monospace 10");
547 bar->bar_height = -1;
548 bar->workspace_buttons = true;
549 bar->strip_workspace_numbers = false;
550 bar->binding_mode_indicator = true;
551 bar->tray_padding = 2;
552 list_add(config->bars, bar);
553
554 return bar;
555}